Source language: Translate to:

help me out please

Questions or information that don't quite fit anywhere else

Moderator: Neosoft Support

help me out please

Postby SpiritHorseNOOT » Wed May 26, 2004 10:00 pm

how to i convert this back to a readable color value


OverTransColor=536870912

thanks in advanced for the help
SpiritHorseNOOT
 

help me out please

Postby HPW » Wed May 26, 2004 10:44 pm

Looks not like a known color value.
Where does it come from?
HPW
 

help me out please

Postby SpiritHorseNOOT » Wed May 26, 2004 10:56 pm

object source code

it kinda sorta matters but not really i suppose would be nice to know just simply to make THIS KICKA## version of SpiritSaver that will be coming out soon.....


(Edited by SpiritHorseNOOT at 1:58 am on May 27, 2004)
SpiritHorseNOOT
 

help me out please

Postby HPW » Wed May 26, 2004 11:16 pm

>object source code

What sort of source-code?

Delphi? C? etc.

Is it Tcolor /HTML color /RGB color?

Maybe a little more code around this statement could help to understand it.
HPW
 

help me out please

Postby SpiritHorseNOOT » Wed May 26, 2004 11:25 pm

Neobooks Object Source Code

{NeoBook Objects}
ObjectType=8
Name=Text8
X=-166
Y=270
W=145
H=68
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 kkkkkkk}}}
HMargin=4
VMargin=4
ObjEnterAction=AlertBox "error." "i don't understand what you are doing"
ObjExitAction=AlertBox "error." "i don't understand what you are doing"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=-2147483645
FillPattern=0
Visible=No
Enabled=No
TabOrder=17

that help any????
SpiritHorseNOOT
 

help me out please

Postby HPW » Wed May 26, 2004 11:43 pm

This should help in that way, that neosoft can now explain us how they transform the internal TColor to this long integer.
HPW
 

help me out please

Postby SpiritHorseNOOT » Wed May 26, 2004 11:53 pm

yeah it would help me out big time

like i said wait till you see what i am doing with spiritsaver it will be ohh about 100times better

when i am done you will be able to see all the Info about an object stored in Spiritsaver including the Actions the object does

(Edited by SpiritHorseNOOT at 2:57 am on May 27, 2004)
SpiritHorseNOOT
 

help me out please

Postby HPW » Thu May 27, 2004 12:32 am

With a bit try and error I get it:

00000000 00000000 11111111 = Red only

00000000 11111111 00000000 = Green only

11111111 00000000 00000000 = Blue only

It is a long integer representing the RGB value.

Put the number from the pub in the windows calculator and convert to binary.  Each Byte represents one color.

And system colors are negativ.


(Edited by HPW at 9:38 am on May 27, 2004)
HPW
 

help me out please

Postby SpiritHorseNOOT » Thu May 27, 2004 12:53 am

ty hpw now i can take that binary number and covert it to a hex color value to make things more understandable

again thanks
SpiritHorseNOOT
 

help me out please

Postby HPW » Thu May 27, 2004 1:07 am

Make 3 Textentry for RGB value from 0-255

Math "[TextEntry1]+([TextEntry2]*256)+([TextEntry3]*256*256)" "0" "[Result]"
HPW
 

help me out please

Postby SpiritHorseNOOT » Thu May 27, 2004 1:47 am

ty hpw you da man ..............................lmfao
SpiritHorseNOOT
 

help me out please

Postby SpiritHorseNOOT » Thu May 27, 2004 5:56 am

ok one last thing that stumps me how to get the RGB value of the - values

{NeoBook Objects}
ObjectType=14
Name=WebBrowser1
X=13
Y=-129
W=155
H=110
VarName=[WebBrowser1Status]
TitleVarName=[WebBrowser1Title]
URLVarName=[WebBrowser1Addr]
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
SilentMode=Yes
ScrollBar=Yes
TrapPopups=Yes
ShowToolBar=Yes
ShowStatusBar=Yes
LineColor=[color=blue]-2147483624
[color=black]LineWidth=1
LineStyle=0
FillColor=[color=blue]-2147483633
[color=black]FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=50
SpiritHorseNOOT
 

help me out please

Postby Sam Cox » Thu May 27, 2004 10:12 am

Bytes from 32-bit Integers

Numbers such as -2147483633 are the signed decimal representation of 32-bit integers which can range in value from -2147483648 to +2147483647: 32 bits --> 4 bytes. When used to represent colors, the four bytes refer to the Red, Green, Blue (RGB) and Alpha (transparency) display channels. I don't know which byte refers to which color.

This hpwNewLisp function returns a space-delimited list of the four bytes that make up a 32-bit integer value.

SYNTAX

    hpwNewLispCall "(bytes [integerValue])" "[result]"

EXAMPLES

    hpwNewLispCall "(bytes -2147483633)" "[bytes]"
    .[bytes] = "128 0 0 15"

    setvar "[value]" "-2147483633"
    hpwNewLispCall "(bytes [value])" "[bytes]"
    strparse "[bytes]" " " "[byte]" "[bytecount]"
    .[byte1] = 128
    .[byte2] = 0
    .[byte3] = 0
    .[byte4] = 15
    .[bytecount] = 4

LISP CODE

    (define (bytes int32)
         (silent (print (join (map string (bytes-aux int32)) " " ))) )

If you'd rather have a comma-separated list of bytes, change the " " to "," in this definition.

   (define (bytes-aux int32)
         (reverse (map (fn (x) (& 255 (+ 256 x))) (unpack "c c c c" (pack "ld" int32)))) )

If you'd rather have the least-significant byte in the return string's left-most position, remove the leading '(reverse ' and trailing ')' from this definition.

(Edited by Sam Cox at 7:32 am on May 27, 2004)
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

help me out please

Postby Neosoft Support » Thu May 27, 2004 10:14 am

If you're using Delphi, you can simply type cast those integers as a TColor. For example:

Color := TColor( 2147483624 );
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

help me out please

Postby SpiritHorseNOOT » Thu May 27, 2004 9:29 pm

can someone just write a small plugin to do this the easy way?

would be a good addition to HPWs Utility plugin


(Edited by SpiritHorseNOOT at 12:32 am on May 28, 2004)
SpiritHorseNOOT
 

Next

Return to Misc. Questions and Information

Who is online

Users browsing this forum: No registered users and 2 guests

cron