0

I have created a windows forms application which has a live view (from a camera) displaying in a picture box. I now need to include a transparent GIF over the live view. The problem is, since windows forms controls don't allow true transparency, I can not simply set a parent and set back color to transparent, since that basically redraws the graphic from the parent to fill transparent parts and my parent is dynamic. I have read that WPF image supports true transparency but not GIF. So as a work around I could create a user control(WPF) and break the gif into several images and then loop over them. I have created my control and used ElementHost to host it but if I place ElementHost over another PictureBox it simply isn't visible. Does anyone know how to fix this, or can suggest a better solution for my problem? Please help....

  • Conceptually simple to do, just draw your gif whenever the "live view" draws a frame. In practice it won't tell you or it flickers like a cheap motel, WPF doesn't solve it either. You solve it by using a layered window on top of the one that displays the live view. Same [as this](http://stackoverflow.com/a/4503371/17034) but with TransparencyKey instead. – Hans Passant Apr 28 '15 at 20:36
  • The WPF "Image" control most certainly does support GIF, including GIFs with transparency. I just tried it to make sure, and it does work. – Rajeev Goel Apr 29 '15 at 01:23

0 Answers0