Sinisterly
Cursor Color Grabbing - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework)
+--- Thread: Cursor Color Grabbing (/Thread-Cursor-Color-Grabbing)



Cursor Color Grabbing - RA1N - 07-02-2014

This snippet lets the user get the color that is located at the cursor.

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)

Hope it helps in anyways possible.

If you have any improvements please leave them below and mention me so I can see it.

Love you HC Brothers/Sisters <3


RE: [Snippet] Cursor Color Grabbing - Psycho_Coder - 07-02-2014

The thread prefix should be source code and not resource Tongue

I have changed it for you. But take care to use appropriate prefix tag next time.


RE: Cursor Color Grabbing - RA1N - 07-02-2014

Will do. It wasn't a full source so I put it as that. I wasn't thinking about the actual resources like library files or gfx. Thank you for the clarification.


RE: Cursor Color Grabbing - ShawnReynolds - 07-03-2014

What exactly does this do? Does it grab the color of the cursor, or the object that the cursor is pointing at?


RE: Cursor Color Grabbing - 1234hotmaster - 07-03-2014

Nice, woulda been better if you could make it in a function to return the cords of the cursor and the colors in a array.


RE: Cursor Color Grabbing - RA1N - 07-04-2014

Who says you can't? this is just some base code that you can implement into systems.


RE: Cursor Color Grabbing - bluedog.tar.gz - 07-04-2014

In what color model does it grab?


RE: Cursor Color Grabbing - RA1N - 07-04-2014

Whatever color you mouse is currently points at. It grabs the first pixel that you cursor is pointing at.


RE: Cursor Color Grabbing - Psycho_Coder - 07-04-2014

(07-04-2014, 05:42 AM)RA1N Wrote: Whatever color you mouse is currently points at. It grabs the first pixel that you cursor is pointing at.

You didnj't understood his question. He is sane enough to understand that which ever pixel he will click it will grab that pixel. He wants to know in which color model will the pixel be shown. COlor Models are CMYK, HSV or HSL, or RGB or ARGB or HEX etc. etc. you didn't get that part.

@bluedog.tar.gz The color model is ARGB. (It is probably what you want to know imo)


RE: Cursor Color Grabbing - bluedog.tar.gz - 07-04-2014

(07-04-2014, 07:33 AM)Psycho_Coder Wrote:
(07-04-2014, 05:42 AM)RA1N Wrote: Whatever color you mouse is currently points at. It grabs the first pixel that you cursor is pointing at.

You didnj't understood his question. He is sane enough to understand that which ever pixel he will click it will grab that pixel. He wants to know in which color model will the pixel be shown. COlor Models are CMYK, HSV or HSL, or RGB or ARGB or HEX etc. etc. you didn't get that part.

@bluedog.tar.gz The color model is ARGB. (It is probably what you want to know imo)

Correct, thank you!