mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 16:56:03 +02:00
Implements TCanvas.BrushCopy, adds a test to it in the canvas tests and also adds full CopyMode tests there
git-svn-id: trunk@35134 -
This commit is contained in:
parent
aa3560ea0f
commit
eed2fffb55
@ -33,17 +33,16 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="73">
|
<Units Count="76">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="canvastest.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="canvastest"/>
|
<UnitName Value="canvastest"/>
|
||||||
<IsVisibleTab Value="True"/>
|
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="6"/>
|
<TopLine Value="6"/>
|
||||||
<CursorPos X="33" Y="28"/>
|
<CursorPos X="33" Y="28"/>
|
||||||
<UsageCount Value="94"/>
|
<UsageCount Value="95"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
@ -53,10 +52,13 @@
|
|||||||
<ComponentName Value="frmCanvasTest"/>
|
<ComponentName Value="frmCanvasTest"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="canvastestunit"/>
|
<UnitName Value="canvastestunit"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="81"/>
|
<TopLine Value="81"/>
|
||||||
<CursorPos X="1" Y="106"/>
|
<CursorPos X="1" Y="106"/>
|
||||||
<UsageCount Value="94"/>
|
<UsageCount Value="95"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="../../../../lazarus/lcl/include/canvas.inc"/>
|
<Filename Value="../../../../lazarus/lcl/include/canvas.inc"/>
|
||||||
@ -139,7 +141,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="3"/>
|
<TopLine Value="3"/>
|
||||||
<CursorPos X="1" Y="28"/>
|
<CursorPos X="1" Y="28"/>
|
||||||
<UsageCount Value="93"/>
|
<UsageCount Value="94"/>
|
||||||
</Unit13>
|
</Unit13>
|
||||||
<Unit14>
|
<Unit14>
|
||||||
<Filename Value="brushtest.pas"/>
|
<Filename Value="brushtest.pas"/>
|
||||||
@ -150,7 +152,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="79"/>
|
<TopLine Value="79"/>
|
||||||
<CursorPos X="1" Y="104"/>
|
<CursorPos X="1" Y="104"/>
|
||||||
<UsageCount Value="93"/>
|
<UsageCount Value="94"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
<Unit15>
|
<Unit15>
|
||||||
<Filename Value="fonttest.pas"/>
|
<Filename Value="fonttest.pas"/>
|
||||||
@ -161,7 +163,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="103"/>
|
<TopLine Value="103"/>
|
||||||
<CursorPos X="1" Y="126"/>
|
<CursorPos X="1" Y="126"/>
|
||||||
<UsageCount Value="93"/>
|
<UsageCount Value="94"/>
|
||||||
</Unit15>
|
</Unit15>
|
||||||
<Unit16>
|
<Unit16>
|
||||||
<Filename Value="rectanglestest.pas"/>
|
<Filename Value="rectanglestest.pas"/>
|
||||||
@ -172,7 +174,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="56"/>
|
<TopLine Value="56"/>
|
||||||
<CursorPos X="1" Y="79"/>
|
<CursorPos X="1" Y="79"/>
|
||||||
<UsageCount Value="93"/>
|
<UsageCount Value="94"/>
|
||||||
</Unit16>
|
</Unit16>
|
||||||
<Unit17>
|
<Unit17>
|
||||||
<Filename Value="../../../../usr/local/share/fpcsrc/packages/fcl-image/src/fpcanvas.pp"/>
|
<Filename Value="../../../../usr/local/share/fpcsrc/packages/fcl-image/src/fpcanvas.pp"/>
|
||||||
@ -278,7 +280,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="21"/>
|
<TopLine Value="21"/>
|
||||||
<CursorPos X="1" Y="53"/>
|
<CursorPos X="1" Y="53"/>
|
||||||
<UsageCount Value="55"/>
|
<UsageCount Value="56"/>
|
||||||
</Unit32>
|
</Unit32>
|
||||||
<Unit33>
|
<Unit33>
|
||||||
<Filename Value="../../../../lazarus/lcl/include/winapih.inc"/>
|
<Filename Value="../../../../lazarus/lcl/include/winapih.inc"/>
|
||||||
@ -330,7 +332,7 @@
|
|||||||
<Filename Value="../../../../lazarus/lcl/interfaces/carbon/carbonlclintf.inc"/>
|
<Filename Value="../../../../lazarus/lcl/interfaces/carbon/carbonlclintf.inc"/>
|
||||||
<TopLine Value="143"/>
|
<TopLine Value="143"/>
|
||||||
<CursorPos X="3" Y="145"/>
|
<CursorPos X="3" Y="145"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="21"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit40>
|
</Unit40>
|
||||||
@ -368,7 +370,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="32"/>
|
<TopLine Value="32"/>
|
||||||
<CursorPos X="1" Y="55"/>
|
<CursorPos X="1" Y="55"/>
|
||||||
<UsageCount Value="35"/>
|
<UsageCount Value="36"/>
|
||||||
</Unit45>
|
</Unit45>
|
||||||
<Unit46>
|
<Unit46>
|
||||||
<Filename Value="screenshotunit.pas"/>
|
<Filename Value="screenshotunit.pas"/>
|
||||||
@ -380,7 +382,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="24"/>
|
<TopLine Value="24"/>
|
||||||
<CursorPos X="1" Y="31"/>
|
<CursorPos X="1" Y="31"/>
|
||||||
<UsageCount Value="35"/>
|
<UsageCount Value="36"/>
|
||||||
</Unit46>
|
</Unit46>
|
||||||
<Unit47>
|
<Unit47>
|
||||||
<Filename Value="drawtest.pas"/>
|
<Filename Value="drawtest.pas"/>
|
||||||
@ -388,10 +390,14 @@
|
|||||||
<ComponentName Value="frmDraw"/>
|
<ComponentName Value="frmDraw"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="drawtest"/>
|
<UnitName Value="drawtest"/>
|
||||||
|
<IsVisibleTab Value="True"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="31"/>
|
<TopLine Value="105"/>
|
||||||
<CursorPos X="1" Y="54"/>
|
<CursorPos X="1" Y="122"/>
|
||||||
<UsageCount Value="34"/>
|
<UsageCount Value="35"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit47>
|
</Unit47>
|
||||||
<Unit48>
|
<Unit48>
|
||||||
<Filename Value="../../../../lazarus/lcl/interfaces/gtk/gtkproc.inc"/>
|
<Filename Value="../../../../lazarus/lcl/interfaces/gtk/gtkproc.inc"/>
|
||||||
@ -425,13 +431,15 @@
|
|||||||
<ComponentName Value="frmImage"/>
|
<ComponentName Value="frmImage"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="imagetest"/>
|
<UnitName Value="imagetest"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="222"/>
|
<TopLine Value="222"/>
|
||||||
<CursorPos X="1" Y="247"/>
|
<CursorPos X="15" Y="224"/>
|
||||||
<UsageCount Value="27"/>
|
<UsageCount Value="28"/>
|
||||||
<Bookmarks Count="1">
|
<Bookmarks Count="1">
|
||||||
<Item0 X="39" Y="137" ID="1"/>
|
<Item0 X="39" Y="137" ID="1"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit52>
|
</Unit52>
|
||||||
<Unit53>
|
<Unit53>
|
||||||
<Filename Value="../../../../lazarus/lcl/include/jpegimage.inc"/>
|
<Filename Value="../../../../lazarus/lcl/include/jpegimage.inc"/>
|
||||||
@ -506,10 +514,12 @@
|
|||||||
<Unit63>
|
<Unit63>
|
||||||
<Filename Value="../../lcl/intfgraphics.pas"/>
|
<Filename Value="../../lcl/intfgraphics.pas"/>
|
||||||
<UnitName Value="IntfGraphics"/>
|
<UnitName Value="IntfGraphics"/>
|
||||||
|
<EditorIndex Value="6"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="228"/>
|
<TopLine Value="101"/>
|
||||||
<CursorPos X="25" Y="250"/>
|
<CursorPos X="3" Y="113"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit63>
|
</Unit63>
|
||||||
<Unit64>
|
<Unit64>
|
||||||
<Filename Value="../../lcl/include/lclintf.inc"/>
|
<Filename Value="../../lcl/include/lclintf.inc"/>
|
||||||
@ -577,52 +587,159 @@
|
|||||||
<CursorPos X="8" Y="28"/>
|
<CursorPos X="8" Y="28"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit72>
|
</Unit72>
|
||||||
|
<Unit73>
|
||||||
|
<Filename Value="../../lcl/graphics.pp"/>
|
||||||
|
<UnitName Value="Graphics"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="400"/>
|
||||||
|
<CursorPos X="1" Y="424"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit73>
|
||||||
|
<Unit74>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<EditorIndex Value="5"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="716"/>
|
||||||
|
<CursorPos X="88" Y="726"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit74>
|
||||||
|
<Unit75>
|
||||||
|
<Filename Value="../../../fpctrunk/packages/fcl-image/src/fpcanvas.pp"/>
|
||||||
|
<UnitName Value="FPCanvas"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="321"/>
|
||||||
|
<CursorPos X="15" Y="333"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit75>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="10" HistoryIndex="9">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="19" Column="34" TopLine="4"/>
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="20" Column="30" TopLine="4"/>
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="21" Column="32" TopLine="4"/>
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="22" Column="31" TopLine="4"/>
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="23" Column="35" TopLine="4"/>
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="24" Column="39" TopLine="4"/>
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="25" Column="32" TopLine="4"/>
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="26" Column="30" TopLine="4"/>
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="27" Column="32" TopLine="4"/>
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="canvastest.lpr"/>
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
<Caret Line="28" Column="33" TopLine="6"/>
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="726" Column="1" TopLine="706"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="724" Column="1" TopLine="706"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="725" Column="1" TopLine="706"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="744" Column="5" TopLine="720"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="710" Column="47" TopLine="696"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="734" Column="27" TopLine="724"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="751" Column="17" TopLine="729"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="../../lcl/include/canvas.inc"/>
|
||||||
|
<Caret Line="728" Column="32" TopLine="716"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="drawtest.pas"/>
|
||||||
|
<Caret Line="64" Column="29" TopLine="50"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="drawtest.pas"/>
|
||||||
|
<Caret Line="78" Column="31" TopLine="57"/>
|
||||||
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
object frmDraw: TfrmDraw
|
object frmDraw: TfrmDraw
|
||||||
Left = 290
|
Left = 290
|
||||||
Height = 274
|
Height = 429
|
||||||
Top = 197
|
Top = 197
|
||||||
Width = 460
|
Width = 566
|
||||||
Caption = 'frmDraw'
|
Caption = 'frmDraw'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnPaint = FormPaint
|
OnPaint = FormPaint
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '0.9.31'
|
||||||
end
|
end
|
||||||
|
@ -40,9 +40,85 @@ begin
|
|||||||
Bmp.Canvas.Brush.Color := clBlue;
|
Bmp.Canvas.Brush.Color := clBlue;
|
||||||
Bmp.Canvas.Rectangle(0, 0, 50, 50);
|
Bmp.Canvas.Rectangle(0, 0, 50, 50);
|
||||||
|
|
||||||
Canvas.TextOut(50, 30, 'cmDstInvert');
|
// BrushCopy
|
||||||
|
|
||||||
|
Canvas.TextOut(50, 30, 'CopyBrush simple');
|
||||||
|
Canvas.Brush.Color := clYellow;
|
||||||
|
Canvas.BrushCopy(Bounds(50, 50, 50, 50), Bmp, Bounds(0, 0, 50, 50), clBlue);
|
||||||
|
|
||||||
|
Canvas.TextOut(200, 30, 'CopyBrush stretch');
|
||||||
|
Canvas.Brush.Color := clYellow;
|
||||||
|
Canvas.BrushCopy(Bounds(200, 50, 20, 20), Bmp, Bounds(0, 0, 50, 50), clBlue);
|
||||||
|
|
||||||
|
Canvas.TextOut(350, 30, 'CopyBrush SrcRect');
|
||||||
|
Canvas.Brush.Color := clYellow;
|
||||||
|
Canvas.BrushCopy(Bounds(350, 50, 20, 20), Bmp, Bounds(30, 30, 20, 20), clBlue);
|
||||||
|
|
||||||
|
// CopyMode
|
||||||
|
|
||||||
|
Canvas.TextOut(50, 130, 'cmBlackness');
|
||||||
|
Canvas.CopyMode := cmBlackness;
|
||||||
|
Canvas.Draw(50, 150, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(150, 130, 'cmDstInvert');
|
||||||
Canvas.CopyMode := cmDstInvert;
|
Canvas.CopyMode := cmDstInvert;
|
||||||
Canvas.Draw(50, 50, Bmp);
|
Canvas.Draw(150, 150, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(250, 130, 'cmMergeCopy');
|
||||||
|
Canvas.CopyMode := cmMergeCopy;
|
||||||
|
Canvas.Draw(250, 150, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(350, 130, 'cmMergePaint');
|
||||||
|
Canvas.CopyMode := cmMergePaint;
|
||||||
|
Canvas.Draw(350, 150, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(450, 130, 'cmNotSrcCopy');
|
||||||
|
Canvas.CopyMode := cmNotSrcCopy;
|
||||||
|
Canvas.Draw(450, 150, Bmp);
|
||||||
|
|
||||||
|
// CopyMode line 2
|
||||||
|
|
||||||
|
Canvas.TextOut(50, 230, 'cmNotSrcErase');
|
||||||
|
Canvas.CopyMode := cmNotSrcErase;
|
||||||
|
Canvas.Draw(50, 250, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(150, 230, 'cmPatCopy');
|
||||||
|
Canvas.CopyMode := cmPatCopy;
|
||||||
|
Canvas.Draw(150, 250, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(250, 230, 'cmPatInvert');
|
||||||
|
Canvas.CopyMode := cmPatInvert;
|
||||||
|
Canvas.Draw(250, 250, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(350, 230, 'cmPatPaint');
|
||||||
|
Canvas.CopyMode := cmPatPaint;
|
||||||
|
Canvas.Draw(350, 250, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(450, 230, 'cmSrcAnd');
|
||||||
|
Canvas.CopyMode := cmSrcAnd;
|
||||||
|
Canvas.Draw(450, 250, Bmp);
|
||||||
|
|
||||||
|
// CopyMode line 3
|
||||||
|
|
||||||
|
Canvas.TextOut(50, 330, 'cmSrcCopy');
|
||||||
|
Canvas.CopyMode := cmSrcCopy;
|
||||||
|
Canvas.Draw(50, 350, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(150, 330, 'cmSrcErase');
|
||||||
|
Canvas.CopyMode := cmSrcErase;
|
||||||
|
Canvas.Draw(150, 350, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(250, 330, 'cmSrcInvert');
|
||||||
|
Canvas.CopyMode := cmSrcInvert;
|
||||||
|
Canvas.Draw(250, 350, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(350, 330, 'cmSrcPaint');
|
||||||
|
Canvas.CopyMode := cmSrcPaint;
|
||||||
|
Canvas.Draw(350, 350, Bmp);
|
||||||
|
|
||||||
|
Canvas.TextOut(450, 330, 'cmWhiteness');
|
||||||
|
Canvas.CopyMode := cmWhiteness;
|
||||||
|
Canvas.Draw(450, 350, Bmp);
|
||||||
|
|
||||||
Bmp.Free;
|
Bmp.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -1110,8 +1110,8 @@ type
|
|||||||
// extra drawing methods (there are more in the ancestor TFPCustomCanvas)
|
// extra drawing methods (there are more in the ancestor TFPCustomCanvas)
|
||||||
procedure Arc(ALeft, ATop, ARight, ABottom, Angle16Deg, Angle16DegLength: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
procedure Arc(ALeft, ATop, ARight, ABottom, Angle16Deg, Angle16DegLength: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
procedure Arc(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
procedure Arc(ALeft, ATop, ARight, ABottom, SX, SY, EX, EY: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
//procedure BrushCopy(Dest: TRect; InternalImages: TBitmap; Src: TRect;
|
procedure BrushCopy(ADestRect: TRect; ABitmap: TBitmap; ASourceRect: TRect;
|
||||||
// TransparentColor: TColor); virtual;
|
ATransparentColor: TColor); virtual;
|
||||||
procedure Chord(x1, y1, x2, y2,
|
procedure Chord(x1, y1, x2, y2,
|
||||||
Angle16Deg, Angle16DegLength: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
Angle16Deg, Angle16DegLength: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
procedure Chord(x1, y1, x2, y2, SX, SY, EX, EY: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
procedure Chord(x1, y1, x2, y2, SX, SY, EX, EY: Integer); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
|
@ -694,6 +694,63 @@ begin
|
|||||||
Changed;
|
Changed;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TCanvas.BrushCopy
|
||||||
|
Params: ADestRect, ABitmap, ASourceRect, ATransparentColor
|
||||||
|
Returns: Nothing
|
||||||
|
|
||||||
|
Makes a stretch draw operation while substituting a color of the source bitmap
|
||||||
|
with the color of the brush of the canvas
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
procedure TCanvas.BrushCopy(ADestRect: TRect; ABitmap: TBitmap; ASourceRect: TRect;
|
||||||
|
ATransparentColor: TColor);
|
||||||
|
var
|
||||||
|
lIntfImage: TLazIntfImage;
|
||||||
|
lTransparentColor, lBrushColor, lPixelColor: TFPColor;
|
||||||
|
lPaintedBitmap: TBitmap;
|
||||||
|
x, y: Integer;
|
||||||
|
lDestWidth, lDestHeight, lSrcWidth, lSrcHeight: Integer;
|
||||||
|
begin
|
||||||
|
// Preparation of data
|
||||||
|
lDestWidth := ADestRect.Right - ADestRect.Left;
|
||||||
|
lDestHeight := ADestRect.Bottom - ADestRect.Top;
|
||||||
|
lSrcWidth := ASourceRect.Right - ASourceRect.Left;
|
||||||
|
lSrcHeight := ASourceRect.Bottom - ASourceRect.Top;
|
||||||
|
lTransparentColor := TColorToFPColor(ColorToRGB(ATransparentColor));
|
||||||
|
lBrushColor := TColorToFPColor(ColorToRGB(Brush.Color));
|
||||||
|
|
||||||
|
lPaintedBitmap := TBitmap.Create;
|
||||||
|
lIntfImage := TLazIntfImage.Create(0, 0);
|
||||||
|
try
|
||||||
|
// First copy the source rectangle to another bitmap
|
||||||
|
// So that we don't have to iterate in pixels which wont be used changing the color
|
||||||
|
lPaintedBitmap.Width := lSrcWidth;
|
||||||
|
lPaintedBitmap.Height := lSrcHeight;
|
||||||
|
lPaintedBitmap.Canvas.Draw(-ASourceRect.Left, -ASourceRect.Top, ABitmap);
|
||||||
|
|
||||||
|
// Next copy the bitmap to a intfimage to be able to make the color change
|
||||||
|
lIntfImage.LoadFromBitmap(lPaintedBitmap.Handle, 0);
|
||||||
|
for x := 0 to lSrcWidth-1 do
|
||||||
|
for y := 0 to lSrcHeight-1 do
|
||||||
|
begin
|
||||||
|
lPixelColor := lIntfImage.Colors[x, y];
|
||||||
|
if (lPixelColor.red = lTransparentColor.red) and
|
||||||
|
(lPixelColor.green = lTransparentColor.green) and
|
||||||
|
(lPixelColor.blue = lTransparentColor.blue) then
|
||||||
|
lIntfImage.Colors[x, y] := lBrushColor;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Now obtain a bitmap with the new image
|
||||||
|
lPaintedBitmap.LoadFromIntfImage(lIntfImage);
|
||||||
|
|
||||||
|
// And stretch draw it
|
||||||
|
Self.StretchDraw(ADestRect, lPaintedBitmap);
|
||||||
|
finally
|
||||||
|
lIntfImage.Free;
|
||||||
|
lPaintedBitmap.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TCanvas.RadialPie
|
Method: TCanvas.RadialPie
|
||||||
Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg: Integer
|
Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg: Integer
|
||||||
|
Loading…
Reference in New Issue
Block a user