How do I Convert ARGB value from string to color?
        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
            13:53 UTC
        
        
        Read the original article
        Hit count: 293
        
delphi-2010
|argb
I am trying to use the MakeColor method in the GDIAPI 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, 0, 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