Get Pixels
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts
Page 1 of 1
If you are making a paint program and want to add a 'Ink Dropper' tool to your form this tutorial will come in handy.
First of all add a timer onto your form.
![Image]()
And double click that timer and type in the following:
Where it says "BackColor, That just means that the color of the pixel your cursor is on will be turned into Form1's Backcolor, Instead of backcolor you could use Forecolor or the Transparency Key.
(Forecolor = the text)
(Transpartency Key = a color that will appear transparent on the form)
![Image]()
You can't see it but my cursor is on the little yellow square in next to "Pixels" ( The Icon )
First of all add a timer onto your form.

And double click that timer and type in the following:
Code: Select all
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
Me.Backcolor = PixelWhere it says "Me" That means Form1, Instead of Me you can use a picturebox, a panel, stuff like that.
Where it says "BackColor, That just means that the color of the pixel your cursor is on will be turned into Form1's Backcolor, Instead of backcolor you could use Forecolor or the Transparency Key.
(Forecolor = the text)
(Transpartency Key = a color that will appear transparent on the form)

You can't see it but my cursor is on the little yellow square in next to "Pixels" ( The Icon )
Well, think of it.
What can this be used for?
I made it because I've seen paint programs on the site and I wanted people to know how they could start to make a 'ColorDropper' tool.
What can this be used for?
I made it because I've seen paint programs on the site and I wanted people to know how they could start to make a 'ColorDropper' tool.
It can be used to get the hexadecimal or RGB properties of a color displayed in your screen: Its very handy sometimes!
Hello Everyone!
I have also made a Color Picker File that works the same but has more features than this! I will upload it later!
I have also made a Color Picker File that works the same but has more features than this! I will upload it later!
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023