Results 1 to 3 of 3

Thread: Picture

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 1999
    Location
    LaGrangePark, IL, USA
    Posts
    5

    Post

    I have two questions:
    1) is there a way that i can store a pixel from a picture box picture and place it into another picture box?
    2)how can i save a picture box as a *.bmp


    ------------------
    neb84

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    2)how can i save a picture box as a *.bmp'
    VB Code:
    1. SavePicture Picture1.Picture, App.Path & "\Test.bmp"
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Originally posted by neb84
    1) is there a way that i can store a pixel from a picture box picture and place it into another picture box?
    VB Code:
    1. Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    2. Public Declare Function SetPixelV Lib "gdi32" Alias "SetPixelV" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
    3.  
    4. Dim Color As Long
    5.  
    6. 'Code for getting and setting the pixel
    7.  
    8. Color = GetPixel(Picture1.hDC, X, Y)
    9. SetPixelV Picture2.hDC, X, Y, Color
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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