Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » image viewer
image viewer [message #3094] |
Sat, 06 May 2006 21:34  |
mjkoskin
Messages: 5 Registered: May 2006
|
Promising Member |
|
|
hi all,
this is my first post and also my first attempt to code ANYTHING gui in c++, so please bear with me. I've coded some simple things with java and not so simple things in tcl/tk, but c++ and especially ms-windows platform is very new to me. I got theIDE working with vc++ 2005 express and have been compiling the examples. But now I'd like to code a real program, a blind deconvolution program, which works now as a console app, but I'd like to add the parameters and also to see a preview in a gui. The problem is that I can't figure out how to display a scrollable image with upp. I haven't found an example of displaying an image, so if someone knowing the guts of upp could post a simple example of a scrollable image viewer and also tell me how to set Image's data from a array. I'm reading the image with openCV library, so I have IplImage, from which I need to extract the data to Image and then display it (ImageDraw I think).
upp looks the best option to do this, because I can create a linux and windows app in the same time.
thanks
-matti
|
|
|
|
|
|
Re: image viewer [message #3098 is a reply to message #3097] |
Sat, 06 May 2006 22:53   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
mjkoskin wrote on Sat, 06 May 2006 21:40 | thanks for the reply.
OpenCV doesn't necessarily need any sdks. In my console app, reading the image was with opencv, as it's simple and it reads variety of ímage files. Also smoothing and convolution is made with opencv, so I didn't need anything else (except fftw3).
No, I'm not that far that I could display anything yet, even opening a file is still obscured, but there are examples I can count on But there's so much things completetly new to me, so it takes time to learn upp, so an example would be nice.
-matti
|
Have you tried from there?
some examples:
http://www.arilect.com/upp/forum/index.php?t=msg&th=42&a mp;a mp;start=0&
|
|
|
|
|
|
|
|
|
Re: image viewer [message #3117 is a reply to message #3094] |
Sun, 07 May 2006 21:57   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
mjkoskin wrote on Sat, 06 May 2006 15:34 |
I haven't found an example of displaying an image, so if someone knowing the guts of upp could post a simple example of a
|
I have to feel guilty responding this post: all the Image stuff is at the approaching end of complete refactoring (implementation and unfortunatly interfaces too). Means, any code using advanced Image things (PixelArray etc) will have to be redone soon... 
Well, let us do it to the advantage. New Image is almost ready, last missing piece (ide/IconDes) has no influence on development, so I am posting the new library here. Just copy files to your MyApps folder so that they will supersede standard packages.
The new Image is quite simple:
- pixel format is always RGBA (4 x 8bit)
- use ImageBuffer to create / modify
- use Image to pass around / display
- use Raster to read other formats (like .PNG, .GIF)
- use RasterEncoder to write other formats
- RasterFormat describes formats
To display image, draw it I guess this example will help you:
void MyApp::Paint(Draw& w)
{
.....
ImageBuffer ib(30, 30);
memset(ib, 0x80, sizeof(RGBA) * ib.GetLength());
Image img = ib;
w.DrawImage(10, 10, img);
......
(Assigns 0x80 to all channels, means creates gray box with 50% opacity (alpha = 128)) and draws it at 10,10).
Mirek
-
Attachment: ndraw.zip
(Size: 1.03MB, Downloaded 1300 times)
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 17:42:05 CEST 2025
Total time taken to generate the page: 0.00449 seconds
|