Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: Fred vS on October 28, 2014, 03:58:25 pm

Title: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 03:58:25 pm
Hello everybody.

I'm glad to present you Color_Picker  ;)

Color_Picker is a tool for managing the colors.
You may get the pixel-color of any part of he screen, compare it, get the hex code of the selected color and much more...
 
Color_Picker uses the fpGUI widgetset and was highly inspired by ColorWheel fpGUI demo. =>
https://github.com/graemeg/fpgui/tree/develop (https://github.com/graemeg/fpgui/tree/develop)

Download Color_Picker  there =>
https://github.com/fredvs/color_picker (https://github.com/fredvs/color_picker)

Here a video of Color_Picker in action and how to use the picker. =>
https://sites.google.com/site/fiensprototyping/color_picker.mp4 (https://sites.google.com/site/fiensprototyping/color_picker.mp4)


In /bin there are compiled executable for Win32/Win64/Linux32/Linux64/freeBSD64.

Have fun.  :)

Fre;D
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 04:44:53 pm
hello @Fred vS
very promissing app thank you
just tested win32 bin and thought you might use some feed back
1) app doesnt retrive colors from intire screen corectly but only from inside the color cycle
if released the mouse anywere  the returned color is constantly this [ $FEFEFE ]
2) when mouse down and  moving the cross cpu raise to 25% 30%
if i notice something else i'll be back
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 07:13:13 pm
@ Never => thanks to test it  ;)

To use the everywhere-color-picker, click on the Picker button maintaining the left-mouse-button pressed.

Then go where you want to get the color-pixel-screen (with the mouse-button still pressed).

Release the button where you want the color => you will get the pixel-color  ;)

If you enable "Continuous", you will get every pixel_color you go...

Fre;D
 
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 07:22:54 pm
Quote
To use the everywhere-color-picker, click on the Picker button maintaining the left-mouse-button pressed.

Then go where you want to get the color-pixel-screen (with the mouse-button still pressed).

Release the button where you want the color => you will get the pixel-color

that is what i did at first place i saw the directions already
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 07:36:17 pm
Quote
that is what i did at first place i saw the directions already

Hum, just tested color_picker.exe from color_picker /bin/windows32 =>
Here it works on Windows 8, Windows 7, XP and via Linux-Wine... :-X

What Windows version are you using ?

Are you sure you maintained the mouse-button clicked ?

Fre;D
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 07:38:30 pm
sure do not worry about it
Quote
What Windows version are you using ?
mentioned on the left side under the nickname

i have thems service off maybe this makes a diff?
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 07:41:42 pm
Quote
i have thems service off maybe this makes a diff?

No, it should work with/without themes...
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 07:44:32 pm
yes just enabled and restarted but nothing changed
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 07:52:54 pm
Quote
yes just enabled and restarted but nothing changed

Hum, i do not understand why it does not work for you.

Maybe somebody else could try it and give his result.  :-[

Only to be sure :

- Click on the Picker button and do not release the button pressed.,

- Travel with your mouse somewhere on the screen (with button still down).

- Release the button on pixel-color you want => you must get the color.

Fre;D
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 07:59:32 pm
Quote
- Click on the Picker button and do not release the button pressed.,

- Travel with your mouse somewhere on the screen (with button still down).

- Release the button => you must get the color.
is pretty clear not something complicated
executed  the exe from several places disabled antivirus firewal the behavior remains
are you testing on virtual box?
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 28, 2014, 08:06:28 pm
Quote
are you testing on virtual box?

No, on pure Windows OS. I have tested on Wine-Linux too.
Title: Re: Color Picker everywhere...
Post by: Never on October 28, 2014, 10:12:09 pm
hello
Here a video of Color_Picker in action on my system

[ https://www.youtube.com/watch?v=dGaSt9nF_q8 ]

can't do more than this
Edit***: please download it an informe to remove it thank you
Title: Re: Color Picker everywhere...
Post by: Fred vS on October 29, 2014, 01:25:24 am
@ Never => Indeed  :-[

Sorry but i do not know why it does not work on your system.

Many thanks for feedback, i will try on other machines to see what is wrong.

Fre;D
Title: Re: Color Picker everywhere...
Post by: Graeme on October 29, 2014, 02:33:11 pm
Maybe somebody else could try it and give his result.  :-[
Tested on 64-bit Win7 system. Works fine here.

The only thing I can comment in is that the tooltop over the "Picker" button appears over the picker button, so when you sometimes click you are actually clicking the tooltip window not the button. Wiggle the mouse and the tooltip disappears. Then clicking the button and picking a color works just fine. I tested on all areas of my desktop.
Title: Re: Color Picker everywhere...
Post by: Zoran on October 29, 2014, 07:53:16 pm
I like it, thank you.
Works well here on linux 64 bit.
Title: Re: Color Picker everywhere...
Post by: nitram on December 08, 2014, 09:55:44 am
Did similar with so called grapherSCOPE by means of Lazarus. On Windows it works perfect. Try to port it for Mac where I currently struggle getting screenshots and RGB readout. Only useful method I found seems to be here http://forum.lazarus.freepascal.org/index.php/topic,16980.0.html

Look grapherSCOPE demo at http://www.m2port.com/

All is based on YCbCr Color space which is useful for Video. With YCbCr you get a better feeling for preceived Color.

Don't know why people are that focused on HSB when it comes to retouching of Images. It seem to be a Photoshop phenomenon....
Title: Re: Color Picker everywhere...
Post by: CM630 on September 08, 2021, 09:36:52 am
I just came into the necessity to pick colours from the screen. I have downloaded this app.
Either I cannot understand how it works or it does not work.
There is no „Help“, just „About“.


Edit: I have watched the video, it somehow helped with some guessing.
Edit 2: The help link in the „About window does not open wheel clicking it.“

Win 10; 64 Bit.
Title: Re: Color Picker everywhere...
Post by: BobDog on September 08, 2021, 01:21:50 pm

Here is a simple no frills colour picker for windows.
Code: Pascal  [Select][+][-]
  1. program finder;
  2. {$macro on}
  3.  {$define _WIN32_WINNT := $0500}
  4. uses windows,crt,sysutils;
  5.    const
  6.     DC_BRUSH=18;
  7.     const
  8.     DC_PEN=19;
  9.  
  10. type
  11. colour =packed record
  12. case integer of
  13. 0:(r,g,b:byte);
  14. 1:(c:longword);
  15. end;
  16.  
  17.  function Printf(mask : pchar):integer; cdecl; varargs; external 'msvcrt.dll' name 'printf';
  18.  function system(s:pchar):integer ; cdecl external 'msvcrt.dll' name 'system';
  19.  function SetDCBrushColor(p:hdc;colour:COLORREF): COLORREF; stdcall external 'gdi32.dll' name 'SetDCBrushColor';
  20.  function SetDCPenColor(p:hdc;colour:COLORREF): COLORREF; stdcall external 'gdi32.dll' name 'SetDCPenColor';
  21.  Function SetProcessDPIAware():boolean ;stdcall external 'User32.dll' name 'SetProcessDPIAware';
  22.  
  23.  procedure hidecursor();
  24.  var
  25.     consoleHandle:handle;
  26.      info:CONSOLE_CURSOR_INFO ;
  27.      begin
  28.      consolehandle := GetStdHandle(STD_OUTPUT_HANDLE);
  29.      info.dwSize := 100;
  30.      info.bVisible := FALSE ;
  31.      SetConsoleCursorInfo(consoleHandle, @info);
  32.      End;
  33.  
  34. Var
  35. p:hwnd;
  36. h,wh:hdc;
  37. pt:point;
  38. clr:colour;
  39. r:integer=50;
  40. s:pchar;
  41. begin
  42.     p := GetConsoleWindow();
  43.     setwindowpos(p, HWND_TOPMOST, 100, 100, 230, 280, SWP_SHOWWINDOW);
  44.     system('title [MOVE]');
  45.     SetWindowLong(p,GWL_STYLE, GetWindowLong(p, GWL_STYLE) and not(WS_MAXIMIZEBOX) and not( WS_SIZEBOX));
  46.     SetProcessDPIAware;
  47.     hidecursor();
  48.     h:=GetDC(0);
  49.     wh:=GetDC(p);
  50.     SelectObject(wh,GetStockObject(DC_BRUSH));
  51.     SelectObject(wh,GetStockObject(DC_PEN));
  52.     while p<>1 do
  53.     begin
  54.     getcursorpos(@pt);
  55.     clr.c:=getpixel(h,pt.x,pt.y);
  56.     ShowScrollBar(p, SB_BOTH, FALSE);
  57.     SetDCBrushColor(wh,clr.c);
  58.     SetDCPenColor(wh,clr.c);
  59.     ellipse(wh,trunc(105-r),trunc(70-r),trunc(105+r),trunc(70+r));
  60.  
  61.   gotoxy(3,10);
  62.   printf('Red   %s','   ');
  63.   gotoxy(3,10);
  64.   printf('Red   %d',clr.r);
  65.  
  66.   gotoxy(3,11);
  67.   printf('Green %s','   ');
  68.   gotoxy(3,11);
  69.   printf('Green %d',clr.g);
  70.  
  71.   gotoxy(3,12);
  72.   printf('Blue  %s','   ');
  73.   gotoxy(3,12);
  74.   printf('Blue  %d',clr.b);
  75.  
  76.   gotoxy(3,13);
  77.   printf('HEX   %s','          ');
  78.   gotoxy(3,13);
  79.   s:=pchar(IntToHex(clr.c,8));
  80.   printf('HEX  %s',' $');
  81.   printf('%s',s);
  82.  
  83.   gotoxy(3,14);
  84.   printf('RAW   %s','          ');
  85.   gotoxy(3,14);
  86.   printf('RAW   %d',clr.c);
  87.  
  88.   gotoxy(3,15);
  89.   printf('X,Y   %s','             ');
  90.   gotoxy(3,15);
  91.   printf('X,Y   %d ,%s %d',pt.x,'',pt.y);
  92.     sleep(20);
  93.     end;
  94.  
  95.   readln;
  96. end.
  97.  
TinyPortal © 2005-2018