|
-
Dec 2nd, 2001, 05:26 PM
#1
Thread Starter
Addicted Member
Help !!!!!!!!!!
How do I get color values from the long number returned by the point command? Like you use in a picture box.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Dec 2nd, 2001, 08:18 PM
#2
Using CopyMemory() or LSet is the easiest way:
Code:
Type RGBN
R as Byte
G as Byte
B as Byte
N as Byte
End Type
...
Dim c as Long
Dim c2 as RGBN
...
LSet c2 = c
'// or CopyMemory(c2, c, 4)
Z.
-
Dec 5th, 2001, 05:36 PM
#3
Thread Starter
Addicted Member
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Dec 5th, 2001, 06:10 PM
#4
Yeah. In normal Win32GDI, that byte is ignored. If you use that method with an alpha color, N will hold the correct value.
Z.
-
Dec 5th, 2001, 08:13 PM
#5
Thread Starter
Addicted Member
Thanks for the help so far, but I get a type mismatch error when I try to use LSet.
Code:
Private Type GroundVertex
'position cords
X As Single
Y As Single
Z As Single
'normal vector
nX As Single
nY As Single
nZ As Single
'Color stuff
Diffuse As Long
Specular As Long
'TextureStuff
TextureUV(2) As D3DVECTOR2 'planning to have 3 layers of textures
End Type
Private Type RGBA
R As Byte
G As Byte
B As Byte
A As Byte
End Type
Private Hmap(255, 255) As Single
Private GroundTiles(16, 16) As Direct3DVertexBuffer8
Private Const FVF_Ground = D3DFVF_XYZ Or D3DFVF_NORMAL Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR _
Or D3DFVF_TEX2
Public Sub Load()
Dim X, Y
Dim c As RGBA
For X = 0 To 255
For Y = 0 To 255
LSet c = PictureForm.Picture1.Point(X, Y) <----------
Hmap(X, Y) = c2.R / 255
Next
Next
Set PictureForm = Nothing
End Sub
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Dec 5th, 2001, 08:26 PM
#6
Then use the CopyMemory API(in my first post).
Z.
-
Dec 5th, 2001, 08:28 PM
#7
Oops, don't need my help!
-
Dec 5th, 2001, 09:24 PM
#8
Thread Starter
Addicted Member
OK I'm an idiot, but VB says that function doesn't exist. Do I have to do a Declare Function thing?
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
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
|