S
Sami
Hello,
I just started out with Windows.Forms and was going through the MS
tutorials.
In the tutorial where you can create a non-rectangular shaped window by
using your own window painted with some paint utility, I am having some
problems with trying to compare the color of the pixel that I retrieve using
Bitmap.GetPixel(...) method.
My pseudo-code looks like this:
****************************************************************************
******
OnMouse_Click(...)
{
Color myColor = Bitmap.GetPixel(e.X, e.Y);
Color colorToCompare = Color.LightBlue; // At this point I notice
that the colorToCompare variable has a value of RGB{0x0}???!!! why?
if (myColor == colorToCompare)
// then execute logic which never does.
}
****************************************************************************
*******
I have another question. The reason I am trying to get the color of the
pixel is because I want to allow a mousemove event only when the user clicks
the mouse on the visible region of my form and not on its transparent
background. But I still have the problem that when a user clicks on the
transparent background of my window the icons (e.g.) that I see on that
position are not chosen? How can I choose the background items on a desktop
or if there is another application on the background when a user clicks on
the transparent background of my form?
I just started out with Windows.Forms and was going through the MS
tutorials.
In the tutorial where you can create a non-rectangular shaped window by
using your own window painted with some paint utility, I am having some
problems with trying to compare the color of the pixel that I retrieve using
Bitmap.GetPixel(...) method.
My pseudo-code looks like this:
****************************************************************************
******
OnMouse_Click(...)
{
Color myColor = Bitmap.GetPixel(e.X, e.Y);
Color colorToCompare = Color.LightBlue; // At this point I notice
that the colorToCompare variable has a value of RGB{0x0}???!!! why?
if (myColor == colorToCompare)
// then execute logic which never does.
}
****************************************************************************
*******
I have another question. The reason I am trying to get the color of the
pixel is because I want to allow a mousemove event only when the user clicks
the mouse on the visible region of my form and not on its transparent
background. But I still have the problem that when a user clicks on the
transparent background of my window the icons (e.g.) that I see on that
position are not chosen? How can I choose the background items on a desktop
or if there is another application on the background when a user clicks on
the transparent background of my form?