Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Draw stuff [SOLVED]
Draw stuff [SOLVED] [message #13903] |
Fri, 01 February 2008 05:21 |
Indio
Messages: 8 Registered: January 2008 Location: Hungary
|
Promising Member |
|
|
Hi all!
I'm newbie with ultimate++ and I have got a little problem with drawing.
I'd like to draw a simple image on the GUI. Where's the error in the following source?
//---------------------------------------------------------- --
ImageBuffer ib( 128, 128 );
for( int y = 0; y < 128; y++) {
RGBA *l = ib[ y ];
for( int x = 0; x < 128; x++) {
// in picture[ ][ ] there is the image
l->a = 255;
l->r = picture[ y ][ x ];
l->g = picture[ y ][ x ];
l->b = picture[ y ][ x ];
l++;
}
}
// Premultiply ( ib ); according to the example, this line is needed, but the compiler gives an error -> the example is not perfect
Image proba_image = ib;
I guess so far the stuff is good
//---------------------------------------------------------- -----------
void MyDraw ( )
{
ImageDraw idraw( 128, 128 );
s.Paint( idraw ); // s is one of the Splittes, I divided the main window
}
//---------------------------------------------------------- ----------
void Paint ( Draw& w )
{
if ( imageLoaded ) // this is true, when the picture is loaded into the memory ( this happens )
{
Image img = proba_image; // this works
w.DrawRect ( 10, 10, 128, 128, White );
w.DrawImage ( 10, 5, img );
}
// Refresh( ); the stuff dies, when this line is active
}
//---------------------------------------------------------- -----------
MyDraw() is called in a proper place, after the image is loaded. But, as a result, nothing happens, the image doesn't apppears on the GUI.
Can you help me in this problem? Thanks in advance!
[Updated on: Mon, 24 January 2011 13:11] by Moderator Report message to a moderator
|
|
|
|
|
Draw stuff [SOLVED]
By: Indio on Fri, 01 February 2008 05:21
|
|
|
Re: Draw stuff
By: mrjt on Fri, 01 February 2008 11:19
|
|
|
Re: Draw stuff
By: Indio on Fri, 01 February 2008 16:09
|
|
|
Re: Draw stuff
By: mrjt on Fri, 01 February 2008 16:44
|
|
|
Re: Draw stuff
By: Indio on Fri, 01 February 2008 21:38
|
|
|
Re: Draw stuff
By: mirek on Fri, 01 February 2008 22:42
|
|
|
Re: Draw stuff
By: Indio on Fri, 01 February 2008 23:41
|
|
|
Re: Draw stuff
By: mrjt on Tue, 05 February 2008 11:03
|
|
|
Re: Draw stuff
By: Indio on Tue, 05 February 2008 23:03
|
|
|
Re: Draw stuff
By: Indio on Fri, 08 February 2008 16:02
|
|
|
Re: Draw stuff
By: mrjt on Fri, 08 February 2008 17:00
|
|
|
Re: Draw stuff
By: Indio on Fri, 08 February 2008 18:09
|
Goto Forum:
Current Time: Sun Jun 09 19:33:29 CEST 2024
Total time taken to generate the page: 0.02198 seconds
|