Hi jjj
What you see in the application giving feedback when drag something over
their windows is not the cursor itself. During D&D the cursor is controlled
by the source application and it is the same for all targets. Yhe target at
the other hand can drag an image along with the cursor to provide visual
feedback to the user. Drawing translucent image can be done in .NET and you
don't have to use nay unmanaged API for that.
Look at the Graphics.DrawImage overloads that take ImageAttribute parameter.
In this image attribute you can set ColorKey or you have a more powerful
option to set a color matrix.
Using color matrix you can draw translucent bitmaps on the screen.
Color matrices works on the same way as transformation matrices with the
difference that they apply on color vectors [RGBAw] where w = 1. I believe
docs say wrong that the vector is [ARGBw]
Anyways, You can draw a translucent image using the following code
ImageAttributes ia = new ImageAttributes();
ColorMatrix cm = new ColorMatrix();
cm.Matrix33 = 0.5F; //50% transparency
ia.SetColorMatrix(cm);
using( Graphics g = CreateGraphics())
{
using(Bitmap bmp = new Bitmap(@"path to some image file"))
{
g.Clear(this.BackColor);
g.DrawImage(bmp, this.ClientRectangle, 0, 0, bmp.Width, bmp.Height,
GraphicsUnit.Pixel, ia);
}