|
|
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Paint problems when using transparency
|
|
|
|
|
|
Re: Paint problems when using transparency [message #41508 is a reply to message #41506] |
Tue, 24 December 2013 09:42 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Now that is really weird. I have tested in Win32 and Linux and both look OK now.
Do you have latest svn sources?
You can also try to add
void Paint2(Draw& dw, ImageBuffer& ib) {
RGBA bckgColor; bckgColor.r = 0; bckgColor.g = 0; bckgColor.b = 0; bckgColor.a = 0;
Upp::Fill( ib.Begin(), bckgColor, ib.GetLength() );
//Premultiply(ib);
BufferPainter bp(ib, _drawMode);
bp.Clear(RGBAZero());
// bp.Clear(White());
bp.DrawRect(Rect(Point(0,0), Point( GetSize().cx, GetSize().cy/2)), White());
// bp.DrawLine(Point(0,GetSize().cy*3/4), Point(GetSize().cx,GetSize().cy*3/4), 4, White() );
ChPaint(bp, GetSize(), _ctrlBckgndStyle );
bp.DrawLine( Point(0,0), Point( GetSize().cx, GetSize().cy), 1 , Red() );
for(const RGBA *s = ~ib; s != ib.End(); ++s) {
ASSERT(s->r <= s->a && s->g <= s->a && s->b <= s->a);
}
}
... that is basically a test that ensures that ib is correctly premultiplied...
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 26 00:20:08 CEST 2024
Total time taken to generate the page: 0.03773 seconds
|
|
|