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 » 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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
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
 
Read Message
Read Message
Read Message
Read Message
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: BufferPainter::Fill(Image,...) optimization question
Next Topic: What is the U++ way to replace a missing font glyph?
Goto Forum:
  


Current Time: Sun Jun 02 04:14:55 CEST 2024

Total time taken to generate the page: 0.02665 seconds