Changeset 568 for trunk/Packages/DpiControls/Dpi.Graphics.pas
- Timestamp:
- May 13, 2024, 6:00:06 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/Packages/DpiControls/Dpi.Graphics.pas (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/DpiControls/Dpi.Graphics.pas
r560 r568 8 8 const 9 9 clBlack = TColor($000000); 10 clWhite = TColor($ffffff); 10 11 11 12 type … … 92 93 93 94 TBrushStyle = Graphics.TBrushStyle; 95 TPenStyle = Graphics.TPenStyle; 94 96 95 97 { TBrush } … … 131 133 function GetHandle: HDC; 132 134 function GetPixel(X, Y: Integer): TColor; 135 function GetTextStyle: TTextStyle; 133 136 procedure SetBrush(AValue: TBrush); 134 137 procedure SetFont(AValue: TFont); … … 137 140 procedure SetPixel(X, Y: Integer; AValue: TColor); 138 141 procedure SetNativeCanvas(AValue: Graphics.TCanvas); 142 procedure SetTextStyle(AValue: TTextStyle); 139 143 protected 140 144 procedure DoLine(X1, Y1, X2, Y2: Integer); virtual; … … 182 186 function TextExtent(const Text: string): TSize; virtual; 183 187 procedure TextOut(X, Y: Integer; const Text: string); virtual; 184 procedure TextRect(ARect: TRect; X, Y: Integer; Text: string); 188 procedure TextRect(ARect: TRect; X, Y: Integer; Text: string); overload; 189 procedure TextRect(ARect: TRect; X, Y: integer; const Text: string; 190 const Style: TTextStyle); overload; 185 191 procedure MoveTo(X, Y: Integer); 186 192 procedure LineTo(X, Y: Integer); … … 196 202 property Width: Integer read GetWidth; 197 203 property Height: Integer read GetHeight; 204 property TextStyle: TTextStyle read GetTextStyle write SetTextStyle; 198 205 published 199 206 property Brush: TBrush read FBrush write SetBrush; … … 966 973 end; 967 974 975 function TCanvas.GetTextStyle: TTextStyle; 976 begin 977 Result := GetNativeCanvas.TextStyle; 978 end; 979 968 980 function TCanvas.GetWidth: Integer; 969 981 begin … … 1039 1051 end; 1040 1052 1053 procedure TCanvas.SetTextStyle(AValue: TTextStyle); 1054 begin 1055 GetNativeCanvas.TextStyle := AValue; 1056 end; 1057 1041 1058 procedure TCanvas.DoLine(X1, Y1, X2, Y2: Integer); 1042 1059 begin … … 1213 1230 procedure TCanvas.TextRect(ARect: TRect; X, Y: Integer; Text: string); 1214 1231 begin 1215 GetNativeCanvas.TextRect(ScaleRectToNative(ARect), ScaleToNative(X), ScaleToNative(Y), Text); 1232 GetNativeCanvas.TextRect(ScaleRectToNative(ARect), ScaleToNative(X), 1233 ScaleToNative(Y), Text); 1234 end; 1235 1236 procedure TCanvas.TextRect(ARect: TRect; X, Y: integer; const Text: string; 1237 const Style: TTextStyle); 1238 begin 1239 GetNativeCanvas.TextRect(ScaleRectToNative(ARect), ScaleToNative(X), 1240 ScaleToNative(Y), Text, TextStyle); 1216 1241 end; 1217 1242
Note:
See TracChangeset
for help on using the changeset viewer.
