0

I'm trying to make a software that displays various GIFs in PictureBox on transparent form background. Everything's fine so far, but there is one difference when I run the program on different systems.

I'm writing it on Win10 64bit laptop with .NET framework up-to-date and the transparency and animation is fine. It's just PictureBox GIF on form that's set with same TransparencyKey as its background Lime color.

I made sure to target .NET 4.0 as I heard that's the last one supported by Win XP. When I transfer it onto my other testing system (VMWare XP SP3, DX9, .NEt 4.0) the form Lime background is visible in the PictureBox area, other parts of the form remain transparent.

How can I get the GIF with transparent background to be displayed on XP desktop using WinForms?

Is this even possible on XP with WinForms? It is not mandatory to make the project for XP but it is highly preferred as the target system is going to be quite weak.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Vojmor
  • 1
  • 2
  • A completely wild guess is that it is actually the background of the image that matters and not the background of the picturebox. And the virtual graphics adapter is operating at a lower bit depth, like 8bpp or 16bpp. – Hans Passant Apr 12 '18 at 17:03
  • Can you use the Form `BackgroundImage` to show your Bitmaps? I know for sure that this works, no matter whether the Image is static or animated. As `Backcolor`/`TransparencyKey`, use Magenta. – Jimi Apr 12 '18 at 17:41

1 Answers1

0

I'd like to thank Hans Passant, as his comment gave me an idea which seems to do the trick.

'A completely wild guess is that it is actually the background of the image that matters and not the background of the picturebox. And the virtual graphics adapter is operating at a lower bit depth, like 8bpp or 16bpp. – Hans Passant 19 hours ago'

I changed all the 'Lime' colors and Transparency Keys mentioned in the code into 'White', and it works fine now...

Vojmor
  • 1
  • 2