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 » image drawn in Paint(Draw &w) does not stay when refereshed
icon14.gif  Re: image drawn in Paint(Draw &w) does not stay when refereshed [message #12943 is a reply to message #12937] Fri, 30 November 2007 00:28 Go to previous messageGo to previous message
amit is currently offline  amit
Messages: 17
Registered: November 2007
Promising Member
mrjt wrote on Thu, 29 November 2007 18:46

I can't get that code to compile in GCC, but my best guess is that logo is an ImageBuffer - When DrawImage is called it converted to an Image and this clears the ImageBuffer so that next Refresh it is empty.

Try changing logo to an Image and doing:
ImageBuffer ib(150,30);
RGBA *pixel = ~ib;
...
logo = ib;


James



Smile Smile Smile thats exactly what it was ... it perfectly solved the problem .... thanks a lot, the change made were exact ... but why does it clears the ImageBuffer in DrawImage()?? let me guess , it is a trade off for performance and stuff?? that works perfectly fine with me (off course it would be fine ... there is another 'clean' method of doing my requirement )

thanks a lot ... i was using ImageCtrl as a solution but there were some side effect as ImageCtrl is a control itself and hence did not behave like the rest of surface client on mouse functions.

the final code is:

Image logo; // changed form ImageBuffer logo; (in the .h main class)

 ----------------------

////////////< ------------------------------------------------------------ ------------------------------------------------------------ --------------------------logo stuff start
ImageBuffer ib = ImageBuffer(150,30); // changed
RGBA *pixel = ~ib; // or (... = ib ) //changed
byte *raw_image_data = (byte *)logo_hex_data;
for(int i=0; i<150*30; i++)
{
pixel->a = 255;
pixel->r = *raw_image_data++;
pixel->g = *raw_image_data++;
pixel->b = *raw_image_data++;
pixel++;
}
ib.SetKind(IMAGE_OPAQUE); // changed

logo = ib; // changed

////////////< ------------------------------------------------------------ ------------------------------------------------------------ ----------------------------------------logo stuff end



one more help ... just wanted to know the exact reason why DrawImage() clears ImageBuffer

[Updated on: Fri, 30 November 2007 07:27]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Previous Topic: Display bug in ArrayCtrl
Next Topic: Why BMPEncoder::NewBmp() doesn´t exists anymoe?
Goto Forum:
  


Current Time: Fri May 03 20:53:07 CEST 2024

Total time taken to generate the page: 0.02191 seconds