| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 15, 2007 10:12 am Post subject: DSU getpixel color + convert to RGB (example: 256|256|256) |
|
|
Does anyone have or want to sell a DSU or DLL that feature below:
getpixel color
able to convert its results to RGB (example: 256|256|256)
I've read most the posts related to get pixel color and converting and checked out ugDLL and VDSDLL.
But I get wrong or close to right colors, I think I need to convert there results to RGB(not sure).
I can't get the System Colors DSU DEMO to work in my VDS5 IDE for some reason, says error in the DSU, maybe I'm doing something wrong, but would like to check it out too.
Thanks for reading  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 15, 2007 1:18 pm Post subject: |
|
|
vtol,
It seems that LiquidCode needs to recompile his System Color DSU with the latest version of VDS 5. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 15, 2007 7:37 pm Post subject: |
|
|
I have VDS v5.02
Thanks for that info, least I wont beat my brains out on System Colors DSU any longer
Looks like I might have to make a convert to RGB DSU myself(it looks so depressing to get started)
I was (greedy) and hoping someone allready made one.
Maybe someone will come by that has something, I wish VDS5 or 6 had a get pixel color, but I need it to read manual positions, not the mouse.
So I could really only make a DSU without the get pixel, unless I used VDSug.DLL or VDSDLL.DLL with my DSU, seems overkill.
EXAMPLE: <below is all I really need>
%p = @getpixcolor(204,310)
Then return it as RGB numbers..
Thanks for reading |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Mar 15, 2007 8:15 pm Post subject: |
|
|
I'll take a look and try to update that ASAP. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 15, 2007 8:33 pm Post subject: |
|
|
cool, thanks a katrillion.
Does it have a better getpixel function? |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Mar 18, 2007 3:21 am Post subject: |
|
|
Chris
I would give you $10 you update it to do the below example and still give you the registration price with it if you have the time to mess with it.
Hope to hear what you do update in it ASP anyways.
EXAMPLE: <below is all I really need>
%p = @getpixcolor(204,310)
Then return it as RGB color numbers..
Please PM me so my email tells me your answering here.
Thanks for considering it or not considering it . . |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Mar 18, 2007 5:09 am Post subject: |
|
|
Thanks for the PM reply Chris
I figured you were a busy man.
I'll try to get that conversion color code working, I think I need to input my color number $123456 at the beginning maybe.
Thanks for looking. |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sun Mar 18, 2007 7:55 am Post subject: |
|
|
What I actually need was VDSug.DLL getpixel RESULT(6 digit HEX) converted to RGB (9 digit decimal).
EXAMPLE:
256|256|256
I think I got it, gotta test it later... |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Mar 19, 2007 2:06 pm Post subject: |
|
|
Vtol,
I don't understand what exactly you are trying to do but here is a little bit of code that will take 6 or 8 digit Hex color values and convert them to RGB format. However normally hex color values have 8 digits and not 6 digits. The extra 2 digits are for ALPHA blending.
| Code: |
#DEFINE FUNCTION,RGB
%%Red = $FF0000
%%Green = $00FF00
%%Blue = $0000FF
%%White = $@Hex(@Sum(%%Red,%%Green,%%Blue),6)
%%RGB = @RGB(%%White)
Info %%RGB
Exit
:RGB
%R =
%C = %1
%z =
If @Equal(@SubStr(%C,1,1),$)
%z = @SubStr(%C,2,@len(%C))
ElsIf @Equal(@SubStr(%C,1,1),#)
%z = @SubStr(%C,2,@len(%C))
ElsIf @Equal(@SubStr(%C,1,2),0x)
%z = @SubStr(%C,3,@len(%C))
Else
%z = %C
End
If @Equal(@len(%Z),6)
If @Equal(%2,HTML)
%R = @sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,1,2),0)
Else
If @Equal(@SubStr(%C,1,1),#)
%R = @sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,1,2),0)
Else
%R = @sum($@SubStr(%Z,1,2),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,5,6),0)
End
End
ElsIf @Equal(@len(%Z),8)
If @Equal(%2,HTML)
%R = @sum($@SubStr(%Z,7,8),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)
Else
If @Equal(@SubStr(%C,1,1),#)
%R = @sum($@SubStr(%Z,7,8),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)
Else
%R = @sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,7,8),0)
End
End
End
Exit %R
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Mon Mar 19, 2007 7:53 pm Post subject: |
|
|
sorry and but thanks for that code..
I found out that in VDSug.DLL its handle feature is not working correctly or I'm doing something wrong.
So it was getting the wrong pixel, therefore causing me think I needed to convert its number result to get the correct matching color.
So after learning this, I was able to add @winpos() with @sum() to get the correct pixel on the main dialog of the program.
So it turns out the 6 digit number VDSug.DLL gave was good without conversion to send to the VDS5 SHAPE dialog during loading of the program.
So below only gets only 1 digit per part.
As you can see I'm no good with color codes
| Code: | # RESULT from VDSug.DLL (getpixel) below:
# D4D0C8
#DEFINE FUNCTION,RGB
%%Red = D4
%%Green = D0
%%Blue = C8
%%White = $@Hex(@Sum(%%Red,%%Green,%%Blue),6)
%%RGB = @RGB(%%White)
Info %%RGB
Exit
:RGB
%R =
%C = %1
%z =
If @Equal(@SubStr(%C,1,1),$)
%z = @SubStr(%C,2,@len(%C))
ElsIf @Equal(@SubStr(%C,1,1),#)
%z = @SubStr(%C,2,@len(%C))
ElsIf @Equal(@SubStr(%C,1,2),0x)
%z = @SubStr(%C,3,@len(%C))
Else
%z = %C
End
If @Equal(@len(%Z),6)
If @Equal(%2,HTML)
%R = @sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,1,2),0)
Else
If @Equal(@SubStr(%C,1,1),#)
%R = @sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,1,2),0)
Else
%R = @sum($@SubStr(%Z,1,2),0)|@sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,5,6),0)
End
End
ElsIf @Equal(@len(%Z),8)
If @Equal(%2,HTML)
%R = @sum($@SubStr(%Z,7,8),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)
Else
If @Equal(@SubStr(%C,1,1),#)
%R = @sum($@SubStr(%Z,7,8),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,3,4),0)
Else
%R = @sum($@SubStr(%Z,3,4),0)|@sum($@SubStr(%Z,5,6),0)|@sum($@SubStr(%Z,7,8),0)
End
End
End
Exit %R |
Hope this kinda explains the confusion I caused in this POST a bit.
Thanks for reading  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|