Develop such a winform with C #

Figure 1, I have one or more photos and some mp3 files. I want to develop winform and load the image into winform, then when the mouse is over certain areas of the image, the area will change and play the mp3 file with a mouse click.

: How to recognize the mouse over the selected area? and then change the color of the area? How to find out what areas of mouse clicks? and play mp3 files.

These areas can be round, oval, rectangular ... perhaps this is a hotspot issue.

will anyone help me? thank!

Figure

+3
source share
2 answers

OvalShape MouseHover . , //- mp3, .

+1

- .

- :

private void Form1_MouseMove(object sender, MouseEventArgs e)
{
  int foundColor = _Mask.GetPixel(e.X, e.Y).ToArgb();

  if (foundColor == Color.Red.ToArgb())
    // do something with this bubble
  else if (foundColor == Color.Blue.ToArgb())
    // do something with this bubble
  else
    // do nothing
}
+1

All Articles