Am 27.02.2012 13:20, schrieb Graeme Geldenhuys: > Hi Martin, > > This is not directly related to MSEgui, but rather a "How did you do > it?" question. I've added PNG support in fpGUI. As expected, painting > images with transparency, shows up wrong. How does one handle the > Alpha channel in the RGBA pixel data of images? What do I need to tell > XLib and GDI to use that information? > > eg: > What i see at the moment in fpGUI... I have a 10x1 test image. The > outer two pixels are 100% transparent. The center pixel is solid blue > and opaque. The pixels moving from the center of the image to the > outer edge has varying degrees of transparency. When fpGUI renders > that image, I see a solid black pixel, a solid blue line, and then > another solid black pixel. > > Any sections of code in MSEgui I can take a look at, or any > information on the Internet you know of that I can read? Any help > would be much appreciated. > MSEgui uses a separate normally server side mask bitmap or pixmap for transparency information. Have a look to tmaskedbitmap in lib/common/graphics/msebitmap.pas. The mask can either be 1 bit monochrome or 32 bit RGB colored. The RGB values are used as alpha for the accordant color channels. XRender supports this formats natively. The backend code is in lib/common/graphics/mse*gdi.pas gdi_copyarea(). Conversion between monchrome <-> color source/destination and stretching is tricky.
Martin ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk