A Colorpicker and RGB-tools

A Colorpicker and RGB-tools

Postby ukoenig » Thu Nov 09, 2017 4:13 pm

Hello Marc

Your question

What i need to do : (we are in business of dresses, sweaters, ...)
I have a xbrowse with thousands of records that show a jpg.
The picture is show in the dialog with a oImage object, and changes when browsing
I need to make a small jpg file or save the colorcode with the color of the product.
So I need a kind of Pipe that I can move over the jpg and when I click,
the value should go into a field inside the browse.
I hope also that the field will color the background into the selected color.
Have you a working sample of something like that?

You can show the product directly in xbrowse and get the colorcode on right mouseclick on the product
You can save the color-value to a extra field
Be sure selecting the maincolor because You can get the values of other colours visible inside the product as well
You can add a extra column that shows a field with the selected color ( control the result of the color-selection )

The basic color

Image

The white symbol

Image

hDC := oBrw:GETDC()
oBrw:bRClicked := {| nRow, nCol | nColor := GETPIXEL( hDC, nCol, nRow ), ;
MsgAlert( "Color : " + LTRIM(STR(nColor)) + CRLF + ;
"Row : " + LTRIM(STR(nRow)) + CRLF + ;
"Col : " + LTRIM(STR(nCol)), "Position") }


don't forget

ReleaseDC(hDC) after oDlg:End()

regards
Uwe :D
Last edited by ukoenig on Mon Dec 04, 2017 12:42 pm, edited 5 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Thu Nov 09, 2017 10:02 pm

Thanks Uwe, This method was even more usefull as my idea. Used it.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Thu Nov 09, 2017 11:58 pm

Uwe,

I get indeed all kind of values, since it will check op pixel level i think. Is it possible to have a larger range, so that my selection will give a better return value ?

Also, conversion from dec to hex ofthen gives a #FFFFFF value. Are they out of range or so ?

Code: Select all  Expand view  RUN

function GetHex(hDc,nCol,nRow)
   nColor := GETPIXEL( hDC, nCol, nRow )
   ATT->ColDec = "#"+alltrim(NUMTOHEX(nColor))
return NIL
 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Fri Nov 10, 2017 12:19 am

I Just found one of your colorpickers. Will try this out...
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby ukoenig » Fri Nov 10, 2017 9:48 am

Marc,

I think it is better to select a fixed color from a dropdown-list ( color-sorted ) next to the image.
A image includes many colors even if Your eye will see just one.
I hope I will have the time this weekend to create a sample that shows what I mean.
Maybe You can give me a colorlist from the colors You want to use.

A part ( group ) of colors are defined inside my RGB-Tools

Image

Have a look at the RGB-tool with defined colorgroups
there You can select the main-colors You want to use.
Maybe You can use the image and tagging the field ( color )

Download
http://www.pflegeplus.com/DOWNLOADS/Rgb10.zip

Image

regards
Uwe :?:
Last edited by ukoenig on Wed Nov 15, 2017 6:43 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Fri Nov 10, 2017 12:59 pm

Uwe,

Creating a page/group (selection of colors) for each manufacturer would be a interesting way, since I can keep the colors more together.

I like the Colorpicker more, since it let me draw the cursor and show the color realtime, until i'm satistied.

I will create the colors from your picker, and close the picker, (You dit open the database exclusive), so that I can open It from my application and process it further.

If you could share some code like in the RGB program, where you show all colors in a mozaik (buttons with all colors from a selected scope), so when pressing on a color, that colorcode
is put into the cell of a Xbrowse that has his pointer to the right artikel.

Thanks.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Fri Nov 10, 2017 3:45 pm

Hey Uwe,

I found a post from you from 2014

viewtopic.php?f=3&t=29764&hilit=pick

There is a program that does just what I need. I think I can addapt this one.

Thanks
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby ukoenig » Sat Nov 11, 2017 9:11 am

Marc,

How many manufacturers You administer and how many colors a manufacturer is using ?
I'm thinking about picking colors from a table ore using a xBrowse.

Creating a page/group (selection of colors) for each manufacturer would be a interesting way, since I can keep the colors more together.


regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Sat Nov 11, 2017 10:32 am

Manuf. up to 40, Colors now over 1200 !

Each brand has his own color Red for example.

I do need it to work in Xbrowse, selecting first a Brand, and than view a xbrowse with only the selected colors.
I can do this in combination with your colorpicker.

I have more trouble in the conversion to Hex. I need hex format for HTML, but I see often that the colors RGB or DEC have will not convert correct with the provided function from FWH
Could you insert also the Hex code in your colorpicker ? Now there are RGB and DEC shown.

Marc
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby Enrico Maria Giordano » Sat Nov 11, 2017 11:00 am

Marc Venken wrote:I have more trouble in the conversion to Hex. I need hex format for HTML, but I see often that the colors RGB or DEC have will not convert correct with the provided function from FWH


This is what I'm using:

Code: Select all  Expand view  RUN
FUNCTION RGBTOHEX( nRed, nGre, nBlu )

    RETURN PADL( DECTOHEX( nRed ), 2, "0" ) + PADL( DECTOHEX( nGre ), 2, "0" ) + PADL( DECTOHEX( nBlu ), 2, "0" )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8724
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: To Marc -> A xBrowse-image colorpicker

Postby ukoenig » Sat Nov 11, 2017 1:12 pm

Marc, Enrico

I added some new functions

1. new hex-values on selected color and brightness
2. saving any of nValue, RGB or Hex - results to the clipboard if needed
just select the needed color, click and paste
3. gradient circle adjusted to new fwh-release

Because the gradient-values are for internal use, I didn't add the hex-values.

I still have to do some tests of the changes

Image

regards
Uwe :D
Last edited by ukoenig on Sat Nov 11, 2017 3:21 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Sat Nov 11, 2017 2:32 pm

Uwe,

Is it also creating/saving to a database ? In the test version it's not as far as I see.

If not, that would be a nice feature, because we could that create a database with all colors we want. If you even let it be possible to
split in differtent lets say Brands, that your tools if even better ))

Dbf.

Brand ColorDec Colorrgb ColorHex ColorNaam

Brand and name has to be edited by us.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: To Marc -> A xBrowse-image colorpicker

Postby ukoenig » Sat Nov 11, 2017 2:38 pm

Marc,

a good idea
like saving to the clipboard I can save to dbf-fields as well.
I will add this function

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby ukoenig » Sat Nov 11, 2017 3:27 pm

Marc,

I added scrollbars to the dialog.
Next I resized to the section < Metro-colors >
Before I activated < to clipboard >
Now I could paste the colorvalues to another program switching between the two programs.
Does it make sense to keep this solution ?

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Marc -> A xBrowse-image colorpicker

Postby Marc Venken » Sat Nov 11, 2017 5:23 pm

In my case it does. I could use this solution in combination with my program.

If we can store it to a dbf, then I would first create some color tables for the most wanted colors with colorpicker, and then integrate that dbf into my own program for selecting colors.
Will post foto next
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests