Results 1 to 8 of 8

Thread: Help !!!!!!!!!!

  1. #1

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136

    Red face 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.

  2. #2
    Zaei
    Guest
    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.

  3. #3

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136
    Whats N for? alpha?
    BTW, Thanks for all your help

    Member of the anti-gay cross-dressing trans-species wolves alliance.

  4. #4
    Zaei
    Guest
    Yeah. In normal Win32GDI, that byte is ignored. If you use that method with an alpha color, N will hold the correct value.

    Z.

  5. #5

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136
    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.

  6. #6
    Zaei
    Guest
    Then use the CopyMemory API(in my first post).

    Z.

  7. #7
    NOMADMAN
    Guest
    Oops, don't need my help!

  8. #8

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136
    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
  •  



Click Here to Expand Forum to Full Width