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 |
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):
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
|
|
|
Goto Forum:
Current Time: Sat Apr 20 06:37:33 CEST 2024
Total time taken to generate the page: 0.08267 seconds
|