I'm designing a Compact Framework Control that supports transparency and for the runtime version of the control everything works just find doing the platform invoke on this API:
[DllImport("coredll.dll")]
extern public static Int32 AlphaBlend(IntPtr hdcDest, Int32 xDest, Int32 yDest, Int32 cxDest, Int32 cyDest, IntPtr hdcSrc, Int32 xSrc, Int32 ySrc, Int32 cxSrc, Int32 cySrc, BlendFunction blendFunction);
Obviously a call to "coredll.dll" isn't going to work in the desktop design time experience and for now, when the painting happens, I'm simply detecting that the control is being designed and painting it without any transparency. I would like to be able to give a better design time experience and show that same transparency in the Visual Studio Designer.
I've tried making this platform call:
[DllImport("gdi32.dll", EntryPoint = "GdiAlphaBlend")]
public static extern bool AlphaBlendDesktop(IntPtr hdcDest, int nXOriginDest, int nYOriginDest,
int nWidthDest, int nHeightDest,
IntPtr hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc,
BlendFunction blendFunction);
but while it returns true, the result is nothing at all is painted to the design time view.
Any thoughts?