|
-
Jul 5th, 2000, 04:44 AM
#1
Is it possible to change the color of a custom shape (bitmap; for example a shape consiting of several lines and circles)during runtime??
-
Jul 5th, 2000, 09:58 AM
#2
Fanatic Member
-
Jul 5th, 2000, 10:02 AM
#3
Fanatic Member
-
Jul 5th, 2000, 10:09 AM
#4
I do not quite understand your question. Do you want to change the Colour of a Bitmap? If so, you can use a Brute-Force method.
This example checks each Pixel in your Picture. If it is a Red Pixel, then it will be converted to Blue.
Code:
Private Sub Command1_Click()
Dim iLength As Integer
Dim iWidth As Integer
'Set the variables to the Height and Width of the Picture
iLength = Picture1.Height
iWidth = Picture1.Width
'Loop through each Pixel of the Picture
For y = 0 To iLength
For x = 0 To iWidth
'DoEvents makes sure the OS doesn't freeze
DoEvents
'Get the Pixel
Retval = GetPixel(Picture1.hdc, x, y)
'If it's Red then convert it to Blue
If Retval = vbRed Then SetPixel Picture1.hdc, x, y, vbBlue
Next x
Next y
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|