Jump to content
Sign in to follow this  
SiteMaze

Hex values in a data variable

Recommended Posts

SiteMaze

I am using the Excel_Com UDF to change the colour of a cell.

$tmp_str_BinColour = 0xFFFFFF

_ExcelCellColorSet($oExcel, 45, 17, 45, 17, 256, $tmp_str_BinColour)

The above code works but how do I store Hex values in a variable?

I have the colour stored in a database. So when I retreive it is in string type. And it doesn't work.

$tmp_str_BinColour = "0xFFFFFF"

_ExcelCellColorSet($oExcel, 45, 17, 45, 17, 256, $tmp_str_BinColour)

Share this post


Link to post
Share on other sites
ProgAndy

Try to use: $tmp_str_BinColour = Binary("0xFFFFFF")


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
ProgAndy

Try StringToBinary("0xFFFFFF")

or Execute("0xFFFFFF")


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
Malkey

Sorry, I was too fast to jump the train.

Execute("0xFF0000") returns 16711680 which is blue colour, and not red.

I am guessing here.

If "0xFF0000" returns blue, the BGR colour scheme could be in use.

If "0x0000FF" returns Red then the BGR color scheme is being used. As opposed to the RGB color scheme.

Share this post


Link to post
Share on other sites
SiteMaze

I am guessing here.

If "0xFF0000" returns blue, the BGR colour scheme could be in use.

If "0x0000FF" returns Red then the BGR color scheme is being used. As opposed to the RGB color scheme.

LOL, you are correct. Just didn't suspect AutoIT will be using the BGR code. I thought it was more to do with the datatype thingy.

So now I had to convert the RGB from my database to BGR and then run through 'execute'. Work great!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×