Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Transparent Background - Image control
|
|
|
Re: Transparent Background - Image control [message #42328 is a reply to message #42327] |
Fri, 07 March 2014 16:03   |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Looks like DrawPainter is missing initialization of an image buffer.
I also stumbled on this kind of issue some time ago when using ImageBuffer and didn't initialize it : if there is no init of the whole buffer then alpha management does not work ==> and you get those black corners
Here is sample code showing the initialization of the ImageBuffer :
RGBA bckgColor; bckgColor.r = 0; bckgColor.g = 0; bckgColor.b = 0; bckgColor.a = 0;
ImageBuffer ib(_plotRect.Size());
Upp::Fill( ib.Begin(), bckgColor, ib.GetLength() );
BufferPainter bp(ib, _drawMode);
PaintPlotData(bp, scale);
dw.DrawImage(0, 0, ib);
NB : using painter to draw images is useless (and slower), so if you don't draw anything else : do not use Painter
[Updated on: Fri, 07 March 2014 16:07] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:44:34 CEST 2025
Total time taken to generate the page: 0.01192 seconds
|