diff options
author | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-11 21:29:57 +0000 |
---|---|---|
committer | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-11 21:29:57 +0000 |
commit | 9f5b0fc182530301b211d3aae3731c50ddcde369 (patch) | |
tree | 62fdc11cb870d7866f2966296296271369afebe1 /gfx/gdi | |
parent | 7b222fba0b399072fdba276baef8cbac784efd46 (diff) | |
download | fpGUI-9f5b0fc182530301b211d3aae3731c50ddcde369.tar.xz |
Added style manager for the new multihandle prototype. Changed color channels from Word to Byte on Gfx.
Diffstat (limited to 'gfx/gdi')
-rw-r--r-- | gfx/gdi/gfx_gdi.pas | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gfx/gdi/gfx_gdi.pas b/gfx/gdi/gfx_gdi.pas index 022867c3..a6107d24 100644 --- a/gfx/gdi/gfx_gdi.pas +++ b/gfx/gdi/gfx_gdi.pas @@ -560,7 +560,7 @@ function TGDICanvas.MapColor(const AColor: TGfxColor): TGfxPixel; begin { Result := Windows.GetNearestColor(Handle, RGB(AColor.Red div 257, AColor.Green div 257, AColor.Blue div 257));} - Result := RGB(AColor.Red div 257, AColor.Green div 257, AColor.Blue div 257); + Result := RGB(AColor.Red, AColor.Green, AColor.Blue); end; @@ -674,14 +674,17 @@ end; function TGDICanvas.TextExtent(const AText: String): TSize; var WideText: WideString; + ASize: Windows.SIZE; begin NeedFont(False); WideText := Utf8Decode(AText); {$ifdef wince} - Windows.GetTextExtentPoint32(Handle, PWideChar(WideText), Length(WideText), @Result) + Windows.GetTextExtentPoint32(Handle, PWideChar(WideText), Length(WideText), @Result); {$else} - Windows.GetTextExtentPoint32W(Handle, PWideChar(WideText), Length(WideText), @Result) + Windows.GetTextExtentPoint32W(Handle, PWideChar(WideText), Length(WideText), ASize); + Result.cx := ASize.cx; + Result.cy := ASize.cy; {$endif} end; @@ -796,9 +799,9 @@ begin for i := 0 to AImage.Palette.EntryCount - 1 do with AImage.Palette.Entries[i] do begin - GDIPal[i].rgbRed := Red div 257; - GDIPal[i].rgbGreen := Green div 257; - GDIPal[i].rgbBlue := Blue div 257; + GDIPal[i].rgbRed := Red; + GDIPal[i].rgbGreen := Green; + GDIPal[i].rgbBlue := Blue; GDIPal[i].rgbReserved := 0; end; Windows.SetDIBColorTable(MemDC, 0, AImage.Palette.EntryCount, GDIPal[0]); @@ -1117,7 +1120,6 @@ var Window: TGDIWindow; PaintStruct: TPaintStruct; r: TRect; - OldCanvas: TFCustomCanvas; begin Result := 0; |