2

I have an application where, beyond my control, several Windows Forms have a TransparencyKey property set. When these windows cover (are in front of) another form which has a DirectDraw video surface, the foreground form flickers (partly showing the form and partly showing the video beneath). The thing is, the color of the TransparencyKey doesn't appear anywhere in the application, so NOTHING should be transparent... in other words, the result should be that the foreground form is completely opaque.

Flickering scenario

Does anyone have experience with DirectDraw surfaces flickering when combined with Windows Forms that are in some form or other set up to be transparent? I've worked on this for weeks, with no success. Thanks!

PNielsen
  • 123
  • 5

1 Answers1

1

I'm sorry but I would suggest that you abandon that goal completely and try to do it some other way.

DirectDraw is one way of displaying stuff on the screen, and forms with regions (that are created on the fly as masks from so called 'transparent key color') are done with GDI. As I see it (and would like to be proven otherwise) - you won't be able to combine that two windows anyway.

And you will probably get different results on different Windows, depending on the version, graphics card used, and so on.

On the other side, can you hack those forms that you don't have the control over and remove TransparencyKey property from them? Even with Win32 API?

Daniel Mošmondor
  • 19,718
  • 12
  • 58
  • 99
  • I was afraid of something like that. Do you have an alternative idea that wouldn't clash with the GDI transparency? I am able to hack the forms, but that causes another problem entirely (unrelated to this). – PNielsen May 24 '11 at 09:34
  • Well, why do you need forms over the video in the first place? Do you draw something on the video surfaces with that method, or it just because your app has windows that can be freely moved around? – Daniel Mošmondor May 24 '11 at 09:59
  • The latter, my application is composed of several forms that can be moved around, and so any form can overlap with any other form. – PNielsen May 24 '11 at 10:34