Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Draw stuff [SOLVED]
Re: Draw stuff [message #13914 is a reply to message #13911] |
Fri, 01 February 2008 16:44   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I see the problem now. You are trying to draw the image into a Splitter, but the Paint routine is a member of the main window yes? If that is correct then the image is being drawn and then the Splitter is drawn over the top.
What you need to do is add a Ctrl to the Splitter, and have the ctrl draw the Image. You can use ImageCtrl for this, though you may with to roll your own once you have it working.
You don't need the Paint function or MyDraw, just:
// Member variables
ImageCtrl imgctrl;
void LoadImage()
{
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++;
}
}
imagectrl.SetImage(ib);
}
// And in your window constuctor
..
splitter.Add(imgctrl);
..
PreMultiply is only needed for versions later the 2007.1, but if I were you I would upgrade to the latest dev version and add the call. Dev versions are always very stable and then you won't have to remember to do it later, plus it's been a long time since 2007.1 and there are manby improvements.
[Updated on: Fri, 01 February 2008 18:19] 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: Thu Aug 21 08:03:27 CEST 2025
Total time taken to generate the page: 0.00794 seconds
|