Results 1 to 4 of 4

Thread: How Can I Pick A Color From A BMP??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question

    Is there any way to move the mouse over a BMP file in my VB app and see what color it is over?

    I am using one of those ActiveX components to shape the form to a bitmap image with a transparent color. I want the user to select the color from the bitmap loaded in a picturebox in a seperate form.

    Any way of doing this? can someone show me a sample code line for this?

    I would greatly appreciate it!

    Warren


  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Theres a method, point(x,y) for pictureboxes, there's an api called getpixel(x,y) for device contexts.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    Here is Vb-World's search results for GetPixel, I'm sure you will find what your looking for .

  4. #4
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Smile MouseDown

    The MouseDown event has the X,Y coordinates of the mouse pointer as arguments. So in the MouseDown Event of the picturebox you can say:

    Code:
      Dim SelectedColor As Long
    
      SelectedColor = picWhatever.Point(X, Y)
    Shrog

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