Jump to content

Hex values in a data variable


Recommended Posts

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...