IDE, Tools, Color Picker - Add eyedrop selector.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
glsevans
New User
New User
Posts: 4
Joined: Tue Dec 09, 2014 11:18 pm

IDE, Tools, Color Picker - Add eyedrop selector.

Post by glsevans »

I would love to see an eye drop selector in the Color Picker Tool to sample color from anywhere on the desktop.
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 625
Joined: Mon May 09, 2011 9:36 am

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by VB6_to_PBx »

glsevans wrote:I would love to see an eye drop selector in the Color Picker Tool to sample color from anywhere on the desktop.
+1
so would i
:)
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Thunder93 »

It would be very convenient for us to have.

I have been using ColorPic. However old utility and with Windows 10, the area capturing isn't under the mouse cursor now.

I don't know if there's anything better but ' Just Color Picker ' from http://annystudio.com/software/colorpicker/ ...does work with also Windows 10.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Zebuddi123 »

Hi This is what i use you will have to set the x,y screnn coord for your screen if you decide to use it. color in hex rgb and desktop mouse x,y
Zebuddi.

Image
postimage org safe

Code: Select all

EnableExplicit

Global iHDC = GetDC_(0), Pixelcolour$

Procedure vQuit()
	ReleaseDC_(0,iHDC)
	End
EndProcedure

Procedure.s  Update()
	Protected  iX.i, iY.i, iPixelColor.i, iRed.i, iGreen.i, iBlue.i
	iX = DesktopMouseX()
	iY = DesktopMouseY()
	iPixelColor = GetPixel_(iHDC,iX,iY)
	iRed = Red(iPixelColor)
	iGreen = Green(iPixelColor)
	iBlue = Blue(iPixelColor)
	PixelColour$ = "Color $" + RSet(Hex(iRed), 2, "0") + RSet(Hex(iGreen), 2, "0") + RSet(Hex(iBlue), 2, "0") 
	If WindowHeight(0) > 10
		PixelColour$ + " RGB(" + Str(iRed) + ", " + Str(iGreen) + ", " + Str(iBlue) + ")"
		SetGadgetText(0, "X:" + Str(iX) + " Y:"+ Str(iY) +" : " + PixelColour$)
	EndIf
EndProcedure	

OpenWindow(0, 1750, 45, 300, 20, "",#PB_Window_BorderLess)
StickyWindow(GetActiveWindow(), #True)

TextGadget(0, 0, 3, 300, 20, "", #PB_Text_Center)

BindEvent(#PB_Event_RightClick, @vQuit(), 0)
          
Define sColor.s, iEvent.i

Repeat
	iEvent = WaitWindowEvent(500)
	Update()
Until iEvent = #PB_Event_CloseWindow
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Lunasole »

Thunder93 wrote: I have been using ColorPic. However old utility and with Windows 10, the area capturing isn't under the mouse cursor now.
Well I can propagand my ColorInspectre utility ^^ Not sure how it works in Win10 but should work
http://geocities.ws/lunasole/data/colorinspectre/l

I've made it as replacement for ColorCop with some extra features.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Thunder93 »

Hi.

@Zebuddi123: Nice stuff. I think a tiny box showing the color would be complementary. Also like using GetSystemMetrics_(#SM_CXSCREEN) and subtract the Window width to get that nice placement regardless of resolution.


@Lunasole: I've actually been to your page already, and downloaded that. I didn't know what to expect since there was no image offered up on the site. :twisted:

Just got around to testing and it works perfectly under Windows 10, and it's spot-on! Excellent job on that. I think this'll be my new fav to replace the old ColorPic utility that isn't accurate under Windows 10, or with my Windows customizations. :wink:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Lunasole »

Thunder93 wrote: @Lunasole: I've actually been to your page already, and downloaded that. I didn't know what to expect since there was no image offered up on the site. :twisted:

Just got around to testing and it works perfectly under Windows 10, and it's spot-on! Excellent job on that. I think this'll be my new fav to replace the old ColorPic utility that isn't accurate under Windows 10, or with my Windows customizations. :wink:
Nice to hear it works fine on 10, I'm still sitting on 7 and not planning move from it anywhere.
Btw thanks for reminded about lack of screenshots. I should add them months ago to that my "homepage" generator, just was too lazy as often. Anyway, finally added ^^
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Thunder93 »

I'm always looking for screenshots. I think screenshots would complement the product page, good decision to include.

There are several old and popular Color picker utilities, and they don't capture directly underneath of the mouse cursor. Your utility is spot-on, wouldn't hurt to mention Windows 10 support for those in doubt.

When you update that utility, do you post an update notification somewhere on this board?

Edit: Answered my own question... You do.. http://www.purebasic.fr/english/viewtop ... 14&t=66495 just you haven't posted about the latest update there. :lol:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: IDE, Tools, Color Picker - Add eyedrop selector.

Post by Lunasole »

Thunder93 wrote:I'm always looking for screenshots. I think screenshots would complement the product page, good decision to include.
[/i]
Yes thats one of things good "for marketing purposes" :) Just stuff I'm posting on that page is not "commercial" so rarely care about such things.
Glad you liked it, tell if there will be some bug, etc
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Post Reply