Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pixel graber
#1
OK so i decided I would make a tutorial on how to make a program that gets the pixel of whatever the mouse pointer is on.

OK so open up Visual Basic and make a windows form application and name it (whatever you want)
Know make the form fairly small beings we will only be displaying the color of the pixel of whatever the mouse pointer is on.

Know that we have the form sized properly go to the toolbox and select timer and then go to the properties window and set enabled to true and set interval to 1.

Know double click on the timer and put this code in:
Code:
Dim BMP As New Drawing.Bitmap(1, 1)
  Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
  GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _
  New Drawing.Point(0, 0), BMP.Size)
  Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0)
  Me.BackColor = Pixel
And then run the project and if done correctly whatever you pace your mouse pointer on it should get that pixel color and display it in the form.

Thank you and please comment.
Reply


Messages In This Thread
Pixel graber - by Phoenix - 07-09-2011, 05:48 PM
RE: Pixel graber - by Relapse - 07-12-2011, 07:30 PM
RE: Pixel graber - by Phoenix - 07-19-2011, 06:17 PM
RE: Pixel graber - by AceInfinity - 07-19-2011, 07:56 PM
RE: Pixel graber - by Phoenix - 07-20-2011, 07:13 AM
RE: Pixel graber - by Drakon - 07-20-2011, 07:51 AM
RE: Pixel graber - by Phoenix - 07-28-2011, 07:38 PM
RE: Pixel graber - by Terridax - 07-28-2011, 07:44 PM
RE: Pixel graber - by AceInfinity - 07-28-2011, 07:48 PM
RE: Pixel graber - by Phoenix - 08-03-2011, 03:28 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)