screen color picker cq. selector

noorman56

New member
Local time
Today, 22:33
Joined
Nov 20, 2021
Messages
3
I want to make an colorpicker in msacces. So i can pick on the desktop screen any color i want.
like the program jcpicker.
This is what working in VB net:
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)
Cpanel.BackColor = pixel
RedTextBox.Text = pixel.R
GreenTextBox.Text = pixel.G
BlueTextBox.Text = pixel.B

But how can i do this in VBA in msacces??
 
Have you tried this one?

 
Or this very similar application which uses some of the same code
 
Last edited:
Is the color picker for your design use or for you to expose to the user? I would be leery of anything that doesn't use themes. Themes are still clunky but they are better than manually choosing colors for objects.
 
Is the color picker for your design use or for you to expose to the user? I would be leery of anything that doesn't use themes. Themes are still clunky but they are better than manually choosing colors for objects.
for me is it important to choose the colors manually of an object. and save the hexcode of the color in the database with project name and name client. So I can see later wich colors is used for various clients and associated projects. And themes are not an issue at all for this project.
 
Just sayin' I've stopped making manual color choices. They are way too time consuming to change if you end up needing to.
 
Last edited:
I believe that this is already possible. In the simplest case a form timer that reads the pixel under the mouse. Attached is a simple example, based on your sample code above.
 

Attachments

Attached is a simple example, based on your sample code above.
Congratulations @Nixversteher, well done! It looks like you were the only respondent, who actually read and understood the question.
I don't like the use of the timer in the example, however I can't think of any alternative that could be implemented with reasonable effort.
 

Users who are viewing this thread

Back
Top Bottom