Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » image viewer
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: Mon May 12 18:02:26 CEST 2025
Total time taken to generate the page: 0.02892 seconds
|