Hello,I have two dimentianal array which I visualizate on screen this way:
Where BALLON_CELL_SIZE is 30.Code:g.DrawImage(img, col * BALLON_CELL_SIZE, row * BALLON_CELL_SIZE);
How can I attach on each drawed image a onclick method ?
Printable View
Hello,I have two dimentianal array which I visualizate on screen this way:
Where BALLON_CELL_SIZE is 30.Code:g.DrawImage(img, col * BALLON_CELL_SIZE, row * BALLON_CELL_SIZE);
How can I attach on each drawed image a onclick method ?
You can't because there is no object. GDI+ drawing is simply coloured pixels. What you need to do is to handle the appropriate event of the object they are drawn on, e.g. form or PictureBox, determine whether the mouse pointer is within the bounds of the drawing and then act accordingly. For an example of this, follow the CodeBank link in my signature and check out my thread on Manipulating GDI+ Drawings.