RobotStudio event

Transparencies ignored on GTPU-2

Options

Hello,

I have recently started to test my application on the new Flexpendant, and I have realized that some .gif's with a transparent background, which were displayed correctly in the former version of the Flexpendant, appear opaque when the application is executed on the new hardware.

The little 16x16 icon displayed on the button in the taskbar, for instance, appears now in a white square!!

I could use some help on that subject...image

Thanks!

Yolanda Casas

Comments

  • John Wiberg
    Options

    The Gif transparancy property has never been supported by WinCE and the Compact Framework. In earlier versions it looked like it was functioning although all non correct colors was replaced with white. Since the FlexPendant interface is very much white it seemed to be OK. But in the Compact Framework 2.0 this has changed. Instead you must use the setcolorkey property of the image, see below.
    (The flexpendant team learnt this during the migration themselves and all images had to be updated to Magenta.)

    private System.Drawing.Imaging.ImageAttributes _imageAttribute;
    _imageAttribute = new System.Drawing.Imaging.ImageAttributes();
    _imageAttribute.SetColorKey(Color.Magenta, Color.Magenta);
    e.Graphics.DrawImage(img,rect,0,0,img.Width, img.Height, GraphicsUnit.Pixel, _imageAttribute);

    Example of such an image from the FlexPendant:
    image