How do I Convert ARGB value from string to colour?

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-04-22T13:52:15Z Indexed on 2010/04/22 14:33 UTC
Read the original article Hit count: 199

Filed under:
|
|

I am trying to use the MakeColor method in the GDIPAPI unit but the conversion from int to byte is not returning me the correct value.

Example

var
    argbStr: string;
    A, R, G, B: Byte;
begin
    argbStr := 'ffffcc88';
    A := StrToInt('$' + Copy(AValue, 1, 2));
    R := StrToInt('$' + Copy(AValue, 3, 2));
    G := StrToInt('$' + Copy(AValue, 5, 2));
    B := StrToInt('$' + Copy(AValue, 7, 2));
    Result := MakeColor(A, R, G, B);
end;

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about argb