forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


DSU getpixel color + convert to RGB (example: 256|256|256)

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 15, 2007 10:12 am    Post subject: DSU getpixel color + convert to RGB (example: 256|256|256) Reply with quote

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 Very Happy
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 15, 2007 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 15, 2007 7:37 pm    Post subject: Reply with quote

I have VDS v5.02
Thanks for that info, least I wont beat my brains out on System Colors DSU any longer Wink

Looks like I might have to make a convert to RGB DSU myself(it looks so depressing to get started) Embarassed

I was (greedy) and hoping someone allready made one. Twisted Evil

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
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Mar 15, 2007 8:15 pm    Post subject: Reply with quote

I'll take a look and try to update that ASAP.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 15, 2007 8:33 pm    Post subject: Reply with quote

cool, thanks a katrillion.

Does it have a better getpixel function?
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Mar 18, 2007 3:21 am    Post subject: Reply with quote

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. Very Happy

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
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Mar 18, 2007 5:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Mar 18, 2007 7:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Mar 19, 2007 2:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Mon Mar 19, 2007 7:53 pm    Post subject: Reply with quote

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 Laughing
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 Wink
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group