mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:29:29 +02:00
+ Some changes for Mattias Gaertner, to use canvas in Lazarus
This commit is contained in:
parent
7abb28ded4
commit
2691c08656
@ -32,7 +32,7 @@ type
|
||||
|
||||
TFPCustomCanvas = class;
|
||||
|
||||
TFPCanvasHelper = class
|
||||
TFPCanvasHelper = class(TPersistent)
|
||||
private
|
||||
FColor : TFPColor;
|
||||
FAllocated,
|
||||
@ -98,26 +98,26 @@ type
|
||||
TFPCustomPen = class (TFPCanvasHelper)
|
||||
private
|
||||
FStyle : TFPPenStyle;
|
||||
FWidth : byte;
|
||||
FWidth : Integer;
|
||||
FMode : TFPPenMode;
|
||||
FPattern : longword;
|
||||
protected
|
||||
procedure DoCopyProps (From:TFPCanvasHelper); override;
|
||||
procedure SetMode (AValue : TFPPenMode); virtual;
|
||||
procedure SetWidth (AValue : byte); virtual;
|
||||
procedure SetWidth (AValue : Integer); virtual;
|
||||
procedure SetStyle (AValue : TFPPenStyle); virtual;
|
||||
procedure SetPattern (AValue : longword); virtual;
|
||||
public
|
||||
function CopyPen : TFPCustomPen;
|
||||
// Creates a copy of the pen with all properties the same, but not allocated
|
||||
property Style : TFPPenStyle read FStyle write SetStyle;
|
||||
property Width : byte read FWidth write SetWidth;
|
||||
property Width : Integer read FWidth write SetWidth;
|
||||
property Mode : TFPPenMode read FMode write SetMode;
|
||||
property Pattern : longword read FPattern write SetPattern;
|
||||
end;
|
||||
TFPCustomPenClass = class of TFPCustomPen;
|
||||
|
||||
TFPBrushStyle = (bsClear, bsSolid, bsDiagonal, bsFDiagonal, bsCross, bsDiagCross,
|
||||
TFPBrushStyle = (bsClear, bsSolid, bsBDiagonal, bsFDiagonal, bsCross, bsDiagCross,
|
||||
bsHorizontal, bsVertical, bsImage, bsPattern);
|
||||
TBrushPattern = array[0..PatternBitCount-1] of TPenPattern;
|
||||
PBrushPattern = ^TBrushPattern;
|
||||
@ -199,8 +199,8 @@ type
|
||||
procedure DoMoveTo (x,y:integer); virtual;
|
||||
procedure DoLineTo (x,y:integer); virtual;
|
||||
procedure DoLine (x1,y1,x2,y2:integer); virtual; abstract;
|
||||
procedure DoCopyRect (x,y:integer; canvas:TFPCustomCanvas; SourceRect:TRect); virtual; abstract;
|
||||
procedure DoDraw (x,y:integer; image:TFPCustomImage); virtual; abstract;
|
||||
procedure DoCopyRect (x,y:integer; canvas:TFPCustomCanvas; Const SourceRect:TRect); virtual; abstract;
|
||||
procedure DoDraw (x,y:integer; Const image:TFPCustomImage); virtual; abstract;
|
||||
procedure CheckHelper (AHelper:TFPCanvasHelper); virtual;
|
||||
procedure AddHelper (AHelper:TFPCanvasHelper);
|
||||
public
|
||||
|
@ -20,7 +20,7 @@ begin
|
||||
FMode := AValue;
|
||||
end;
|
||||
|
||||
procedure TFPCustomPen.SetWidth (AValue : byte);
|
||||
procedure TFPCustomPen.SetWidth (AValue : Integer);
|
||||
begin
|
||||
if AValue < 1 then
|
||||
FWidth := 1
|
||||
|
@ -205,7 +205,7 @@ begin
|
||||
FillRectangleImage (self, left,top, right,bottom, brush.image)
|
||||
else
|
||||
raise PixelCanvasException.Create (sErrNoImage);
|
||||
bsDiagonal : FillRectangleHashDiagonal (self, b, FHashWidth);
|
||||
bsBDiagonal : FillRectangleHashDiagonal (self, b, FHashWidth);
|
||||
bsFDiagonal : FillRectangleHashBackDiagonal (self, b, FHashWidth);
|
||||
bsCross :
|
||||
begin
|
||||
@ -235,7 +235,7 @@ begin
|
||||
FillEllipseImage (self, Bounds, brush.image)
|
||||
else
|
||||
raise PixelCanvasException.Create (sErrNoImage);
|
||||
bsDiagonal : FillEllipseHashDiagonal (self, Bounds, FHashWidth, brush.color);
|
||||
bsBDiagonal : FillEllipseHashDiagonal (self, Bounds, FHashWidth, brush.color);
|
||||
bsFDiagonal : FillEllipseHashBackDiagonal (self, Bounds, FHashWidth, brush.color);
|
||||
bsCross : FillEllipseHashCross (self, Bounds, FHashWidth, brush.color);
|
||||
bsDiagCross : FillEllipseHashDiagCross (self, Bounds, FHashWidth, brush.color);
|
||||
@ -277,7 +277,7 @@ begin
|
||||
FillFloodImage (self, x,y, brush.image)
|
||||
else
|
||||
raise PixelCanvasException.Create (sErrNoImage);
|
||||
bsDiagonal : FillFloodHashDiagonal (self, x,y, FHashWidth);
|
||||
bsBDiagonal : FillFloodHashDiagonal (self, x,y, FHashWidth);
|
||||
bsFDiagonal : FillFloodHashBackDiagonal (self, x,y, FHashWidth);
|
||||
bsCross : FillFloodHashCross (self, x,y, FHashWidth);
|
||||
bsDiagCross : FillFloodHashDiagCross (self, x,y, FHashWidth);
|
||||
|
Loading…
Reference in New Issue
Block a user