Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Draw stuff [SOLVED]
Draw stuff [SOLVED] [message #13903] Fri, 01 February 2008 05:21 Go to previous message
Indio is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Optimized storage of 1BPP images
Next Topic: Drawing and scrolling
Goto Forum:
  


Current Time: Sun Jun 09 19:33:29 CEST 2024

Total time taken to generate the page: 0.02198 seconds