One colour value of the image may be used as a mask colour which will lead to the automatic creation of a wxMask object associated to the bitmap object. By splitting the responsibilities between wxImage/wxBitmap like this then it's easier to use generic code shared by all platforms and image types for generic operations and platform specific code where performance or compatibility is needed. OTOH, wxBitmap is intended to be a wrapper of whatever is the native image format that is quickest/easiest to draw to a DC or to be the target of the drawing operations performed on a wxMemoryDC. It includes generic code for scaling, resizing, clipping, and other manipulations of the image data. It is all generic, platform independent and image file format independent code. More on the difference between wxImage and wxBitmap: wxImage is just a buffer of RGB bytes with an optional buffer for the alpha bytes. This bitmap can then be drawn in a device context, using wxDC::DrawBitmap. Instead, a platform-specific wxBitmap object must be created from it using the wxBitmap::wxBitmap(wxImage,int depth) constructor. Functions are available to set and get image bits, so it can be used for basic image manipulation.Ī wxImage cannot (currently) be drawn directly to a wxDC. An image can be loaded from a file in a variety of formats, and is extensible to new formats via image format handlers. However, the color rendered by the brush has an intensity that is 75 percent of what it would be if the alpha component were 255.This class encapsulates a platform-independent image.Īn image can be created from data, or using wxBitmap::ConvertToImage. If your Graphics object has its compositing mode set to CompositingModeSourceCopy, then the background color is not blended with the brush color. If your Graphics object has its compositing mode set to CompositingModeSourceOver, then areas filled with the solid brush are a blend that is 75 percent brush color and 25 percent background color. Suppose you create a SolidBrush object based on a color that has an alpha component of 192, which is about 75 percent of 255. i’m not sure how the hooks into the system work, but i’m sure you can probably stick that in nativeFill pretty quickly to see if that’s the solution. they seem to affect the gdi drawing routines. There are two variations, copy and composite. Maybe you can do a diff on the two versions, and try to find the bug in the generated patch file. It is clearly not a premultiplication problem as the red and blue component are correct. It smells like copy and paste error somewhere, I don’t think it’s due to any Win32 API misunderstanding (I have used UpdateLayeredWindow a lot before, and the premultiplication is required, at least on WinXP). With the 1.12 version, inside the dialog the color is (184, 209, 200), but the same color when added to the desktop becomes (184, 189, 200).Īs far as I can see, it seems that the previous version contained some (limited) rounding errors on the process, while the new version doesn’t have errors, but doesn’t compute the green value correctly. It happened between 1.11 and 1.12 (or maybe 1.10 and 1.11 as I didn’t check the demo for 1.11)īy looking to the colors themselves, on 1.10, when the component was inside the window, its background was (183, 208, 199) and, when added to the desktop, its overlapping part (with the dialog) was (184, 210, 200) which is almost the same but not exactly Got a picture of what is happening at home
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |