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 » Bug: ImageBuffer::alpha not initialised on X11
Bug: ImageBuffer::alpha not initialised on X11 [message #15575] Tue, 29 April 2008 14:34 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The alpha channel is not correctly initialised on X11. This causes corruption (second image is what it should look like):
index.php?t=getfile&id=1177&private=0
Everything works correctly for Win32. The code below exibits the problem:
class ImageDrawTest : public TopWindow {
public:
	typedef ImageDrawTest CLASSNAME;
	Image img;
	
	ImageDrawTest() {
		Sizeable();
		GenerateImage();
	}
	
	void GenerateImage() {
		Size sz(100, 100);
		ImageDraw w(sz);
//		w.Alpha().DrawRect(sz, Black());
		w.Alpha().DrawRect(30, 30, 40, 40, White());
		w.DrawRect(sz, Red);
		img = w;
	}
	
	virtual void Paint(Draw &w) {
		w.DrawRect(GetSize(), SColorFace());
		w.DrawImage(0, 0, img);	
	}
	
	virtual void LeftUp(Point p, dword keyflags) {
		GenerateImage();	
		Refresh();
	}
};

If you uncomment the line above, the channel is initialised and everything works correctly.

Edit: Looking at the manual for XCreatePixmap, it says the pixmap contents are undefined, which I guess is fair enough. My main issue here is the inconsistency between Win32/Linux, both should be either defined or undefined.

[Updated on: Tue, 29 April 2008 14:43]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bug in ImageBuffer::Line() and operator[]
Next Topic: .pcx images [FEATURE REQUEST]
Goto Forum:
  


Current Time: Sat Apr 20 06:37:33 CEST 2024

Total time taken to generate the page: 0.08267 seconds