Avatar uživatele
klikihak

HOW TO MAKE e.Graphics.Dra­wImage/myBitmap TRUE (click)

when I have some code like this:

Private Sub MakeTransparen­t_Example1(By­Val e As PaintEventArgs)

' Create a Bitmap object from an image file.
Dim myBitmap As New Bitmap(„Grapes­.gif“)

' Draw myBitmap to the screen.
e.Graphics.Dra­wImage(myBitmap, 0, 0, myBitmap.Width, _
myBitmap.Height)

' Make the default transparent color transparent for myBitmap.
myBitmap.Make­Transparent()

' Draw the transparent bitmap to the screen.
e.Graphics.Dra­wImage(myBitmap, myBitmap.Width, 0, myBitmap.Width, _
myBitmap.Height)

End Sub

How can I make this drawned shape „true“, whitch code I should use to make something, some action, when I clicked on this shape.

I mean/need something like this:

Private Sub e.Graphics.Dra­wImage.myBitmap_Clic­k(sender As Object, e As EventArgs) Handles e.Graphics.Dra­wImage.myBitmap­.Click
If True Then e.Graphics.Dra­wImage.myBitmap­.BackColor = Color.Black
End Sub

Basicly, I have a button1 in RED color and I need this: when I click on the one of shapes I need turn color of this shape to RED and when color of button1 is BLUE and I click on the one of shapes I need turn color of this shape to BLUE and so on. But here is the point: I have a lot of irregular shapes fitting into each other (like puzzles), so please, how should I do It? Thank you for your answer.

And If you have another solusion for these irregular shapes fitting into each other (like puzzles) whitch should change color or at least change themselves with picture of the same shape, but same color, it will be grat. Thanks

Zajímavá 0 před 4340 dny Sledovat Nahlásit



Odpovědi
Avatar uživatele
honza19hk

Czech,Please.
Doplňuji:
or Russian

Upravil/a: honza19hk

0 Nominace Nahlásit


Diskuze k otázce

U otázky nebylo diskutováno.

Nový příspěvek
Zajímavé otázky v kategorii Počítače a internet