mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 13:39:18 +02:00
Expands the brush test
git-svn-id: trunk@36612 -
This commit is contained in:
parent
e01c9d3a71
commit
1190fc3785
@ -5,5 +5,5 @@ object frmBrush: TfrmBrush
|
||||
Width = 400
|
||||
Caption = 'frmBrush'
|
||||
OnPaint = FormPaint
|
||||
LCLVersion = '0.9.29'
|
||||
LCLVersion = '1.1'
|
||||
end
|
||||
|
@ -43,42 +43,9 @@ begin
|
||||
MyBitmap.Canvas.Brush.Color := clWhite;
|
||||
MyBitmap.Canvas.Pen.Color := clWhite;
|
||||
MyBitmap.Canvas.Rectangle(0, 0, Width, Height);
|
||||
{ // Explaning text
|
||||
// Explaning text
|
||||
MyBitmap.Canvas.TextOut(100, 5, 'Brush: Blue Pen: Black');
|
||||
|
||||
// Brush styles
|
||||
|
||||
MyBitmap.Canvas.TextOut( 25, 30, 'Brush styles:');
|
||||
|
||||
MyBitmap.Canvas.TextOut( 25, 60, 'bsSolid');
|
||||
MyBitmap.Canvas.TextOut(125, 60, 'bsClear');
|
||||
MyBitmap.Canvas.TextOut(225, 60, 'bsHorizontal');
|
||||
MyBitmap.Canvas.TextOut(325, 60, 'bsVertical');
|
||||
MyBitmap.Canvas.TextOut( 25, 160, 'bsFDiagonal');
|
||||
MyBitmap.Canvas.TextOut(125, 160, 'bsBDiagonal');
|
||||
MyBitmap.Canvas.TextOut(225, 160, 'bsCross');
|
||||
MyBitmap.Canvas.TextOut(325, 160, 'bsDiagCross');
|
||||
|
||||
MyBitmap.Canvas.Brush.Color := clBlue;
|
||||
MyBitmap.Canvas.Pen.Color := clBlack;
|
||||
|
||||
MyBitmap.Canvas.Brush.Style := bsSolid;
|
||||
MyBitmap.Canvas.Rectangle(Bounds( 25, 75, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsClear;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(125, 75, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsHorizontal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(225, 75, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsVertical;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(325, 75, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsFDiagonal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds( 25, 175, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsBDiagonal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(125, 175, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsCross;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(225, 175, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsDiagCross;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(325, 175, 50, 50));}
|
||||
|
||||
// Image brushes
|
||||
MyBitmap.Canvas.TextOut( 25, 25, 'Canvas-aligned bitmapped Brush:');
|
||||
|
||||
@ -94,6 +61,45 @@ begin
|
||||
MyBitmap.Canvas.Brush.Bitmap.Free;
|
||||
MyBitmap.Canvas.Brush.Bitmap := nil;
|
||||
|
||||
// Brush styles
|
||||
|
||||
MyBitmap.Canvas.TextOut( 25, 110, 'Brush styles:');
|
||||
|
||||
MyBitmap.Canvas.TextOut( 25, 130, 'bsSolid');
|
||||
MyBitmap.Canvas.TextOut(125, 130, 'bsClear');
|
||||
MyBitmap.Canvas.TextOut(225, 130, 'bsHorizontal');
|
||||
MyBitmap.Canvas.TextOut(325, 130, 'bsVertical');
|
||||
MyBitmap.Canvas.TextOut( 25, 200, 'bsFDiagonal');
|
||||
MyBitmap.Canvas.TextOut(125, 200, 'bsBDiagonal');
|
||||
MyBitmap.Canvas.TextOut(225, 200, 'bsCross');
|
||||
MyBitmap.Canvas.TextOut(325, 200, 'bsDiagCross');
|
||||
|
||||
MyBitmap.Canvas.Brush.Color := clBlue;
|
||||
MyBitmap.Canvas.Pen.Color := clBlack;
|
||||
|
||||
MyBitmap.Canvas.Brush.Style := bsSolid;
|
||||
MyBitmap.Canvas.Rectangle(Bounds( 25, 145, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsClear;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(125, 145, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsHorizontal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(225, 145, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsVertical;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(325, 145, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsFDiagonal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds( 25, 215, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsBDiagonal;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(125, 215, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsCross;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(225, 215, 50, 50));
|
||||
MyBitmap.Canvas.Brush.Style := bsDiagCross;
|
||||
MyBitmap.Canvas.Rectangle(Bounds(325, 215, 50, 50));
|
||||
|
||||
// FillRect
|
||||
MyBitmap.Canvas.TextOut( 25, 280, 'FillRect');
|
||||
MyBitmap.Canvas.Brush.Color := clGray;
|
||||
MyBitmap.Canvas.Brush.Style := bsSolid;
|
||||
MyBitmap.Canvas.FillRect(Bounds( 25, 300, 50, 50));
|
||||
|
||||
{ Draw the bitmap to the form }
|
||||
Canvas.Draw(0, 0, MyBitmap);
|
||||
finally
|
||||
|
@ -84,6 +84,7 @@
|
||||
<Filename Value="brushtest.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="frmBrush"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="brushtest"/>
|
||||
</Unit3>
|
||||
|
Loading…
Reference in New Issue
Block a user