File: lazcanvas.xml

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (1257 lines) | stat: -rw-r--r-- 37,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
<?xml version="1.0" encoding="UTF-8"?>
<!--

Documentation for LCL (Lazarus Component Library) and LazUtils (Lazarus 
Utilities) are published under the Creative Commons Attribution-ShareAlike 4.0 
International public license.

https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/docs/cc-by-sa-4-0.txt

Copyright (c) 1997-2025, by the Lazarus Development Team.

-->
<fpdoc-descriptions>
<package name="lcl">
<!--
====================================================================
LazCanvas
====================================================================
-->
<module name="LazCanvas">
<short>
Classes and functions for extending TFPImageCanvas.
</short>
<descr>
<p>
<file>lazcanvas.pas</file> contains classes and functions for extending 
TFPImageCanvas to support more stretching filters, and to support all 
features from the LCL TCanvas. TLazCanvas also fixes various small problems 
and incompatibilities between TFPImageCanvas versions, making the interface 
smoother and more consistent.
</p>
<p>
Do not use anything from the <b>LCL</b> here, as this unit should be kept 
strictly independent. <file>LCLProc.pas</file> is allowed for DebugLn, but 
only during debugging or profiling.
</p>
<p>
Author: Felipe Monteiro de Carvalho
</p>
</descr>

<!-- unresolved external references -->
<element name="Classes"/>
<element name="SysUtils"/>
<element name="Contnrs"/>
<element name="Math"/>
<element name="fpimgcanv"/>
<element name="fpcanvas"/>
<element name="fpimage"/>
<element name="clipping"/>
<element name="pixtools"/>
<element name="fppixlcanv"/>
<element name="IntfGraphics"/>
<element name="LazRegions"/>
<!-- used for debugging or profiling -->
<element name="LazSysUtils"/>
<element name="LCLProc"/>

<element name="TLazCanvasImageFormat">
<short>Identifies image formats supported in TLazCanvas.</short>
<descr>
<p>
Used in the implementation of the <var>CanvasCopyRect</var> method in 
<var>TLazCanvas</var>, and in custom-drawn LCL controls to speed up image 
drawing in the LCL interface.
</p>
</descr>
<seealso>
<link id="TLazCanvas.CanvasCopyRect"/>
</seealso>
</element>
<element name="TLazCanvasImageFormat.clfOther">
<short>Images use a format other than those in this enumeration.</short>
</element>
<element name="TLazCanvasImageFormat.clfRGB16_R5G6B5">
<short>Images use 16-bit RGB colors.</short>
</element>
<element name="TLazCanvasImageFormat.clfRGB24">
<short>Images use 24-bit RGB colors.</short>
</element>
<element name="TLazCanvasImageFormat.clfRGB24UpsideDown">
<short>Images use 24-bit RGB colors with inverse values.</short>
</element>
<element name="TLazCanvasImageFormat.clfBGR24">
<short>Images use 24-bit BGR colors.</short>
</element>
<element name="TLazCanvasImageFormat.clfBGRA32">
<short>Images use 32-bit BGR colors with an Alpha channel.</short>
</element>
<element name="TLazCanvasImageFormat.clfRGBA32">
<short>Images use 32-bit RGB colors with an Alpha channel.</short>
</element>
<element name="TLazCanvasImageFormat.clfARGB32">
<short>
Images use 32-bit RGB colors with an Alpha channel in the low-order octet.
</short>
</element>

<element name="TFPSharpInterpolation">
<short>Implements a very sharp and square interpolation.</short>
<descr>
<p>
TFPSharpInterpolation implements a very sharp and square interpolation for 
stretching, similar to StretchBlt from the Windows API.
</p>
</descr>
<seealso/>
</element>

<element name="TFPSharpInterpolation.Execute">
<short>
Paints an image on the Canvas using the specified coordinates and dimensions.
</short>
<descr/>
<seealso/>
</element>
<element name="TFPSharpInterpolation.Execute.x">
<short>Horizontal coordinate.</short>
</element>
<element name="TFPSharpInterpolation.Execute.y">
<short>Vertical coordinate.</short>
</element>
<element name="TFPSharpInterpolation.Execute.w">
<short>Width for the output.</short>
</element>
<element name="TFPSharpInterpolation.Execute.h">
<short>Height for the output.</short>
</element>

<element name="TLazCanvasState">
<short>Contains properties reflecting the state for a Lazarus canvas.</short>
<descr>
<p>
<var>TLazCanvasState</var> is a class with public members that reflect the 
state for a <var>TLazCanvas</var> instance. A destructor is provided to 
ensure that resources allocated to members variables are freed before the 
class instance is destroyed.
</p>
<p>
Instances of <var>TLazCanvasState</var> are created, stored, and retrieved 
using an internal list in <var>TLazCanvas</var> in its <var>SaveState</var> 
and <var>RestoreState</var> methods.
</p>
</descr>
<seealso>
<link id="TLazCanvas.SaveState"/>
<link id="TLazCanvas.RestoreState"/>
<link id="TLazCanvas.AssignedBrush"/>
<link id="TLazCanvas.AssignedFont"/>
<link id="TLazCanvas.AssignedPen"/>
<link id="TLazCanvas.BaseWindowOrg"/>
<link id="TLazCanvas.WindowOrg"/>
</seealso>
</element>

<element name="TLazCanvasState.Brush">
<short>Brush for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvasState.Pen">
<short>Pen for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvasState.Font">
<short>Font for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvasState.BaseWindowOrg">
<short>Base window origin for the canvas.</short>
<descr>
<p>
The values in <var>WindowOrg</var> are relative to the coordinates in 
<var>BaseWindowOrg</var>. BaseWindowOrg coordinates are relative to the 
canvas for the containing Form. It is useful when implementing the non-native 
windowed controls.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvasState.WindowOrg">
<short>Window origin for the canvas.</short>
<descr>
<p>
Contains the absolute coordinates for the canvas with 
<var>BaseWindowOrg</var> summed up.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvasState.Clipping">
<short>Indicates if Clipping is enabled for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvasState.ClipRegion">
<short>Defines the clipping region for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvasState.Destroy">
<short>Destructor for the class instance.</short>
<descr>
<p>
<var>Destroy</var> is the overridden destructor for the class instance. 
Destroy ensures that resources allocated for the <var>Brush</var> and 
<var>Pen</var> properties are freed before the class instance is destroyed. 
Destroy calls the inherited destructor prior to exiting from the method.
</p>
</descr>
<seealso>
<link id="TLazCanvasState.Brush"/>
<link id="TLazCanvasState.Pen"/>
</seealso>
</element>

<element name="TLazCanvas">
<short>
Implements a canvas which masks differences between FCL and LCL canvas 
classes.
</short>
<descr>
<p>
<var>TLazCanvas</var> is an FCL <var>TFPImageCanvas</var> descendant. 
TLazCanvas extends the ancestor class to support stretching filters and 
features found in the <var>TCanvas</var> class from the LCL. TLazCanvas also 
fixes various small problems and incompatibilities between 
<var>TFPImageCanvas</var> versions, making the interface smoother and more 
consistent.
</p>
<p>
TLazCanvas is used in the implementation of custom-drawn widgetset classes, 
and provides a device context used to perform drawing operations for a 
control.
</p>
<p>
There are several useful examples using TLazCanvas on the Lazarus Wiki at:
</p>
<p>
<url href="https://wiki.freepascal.org/Developing_with_Graphics">
Developing with Graphics
</url>
</p>
</descr>
<seealso>
<link id="#lcl.graphics.TCanvas">TCanvas</link>
</seealso>
</element>

<element name="TLazCanvas.FAssignedBrush"/>
<element name="TLazCanvas.FAssignedFont"/>
<element name="TLazCanvas.FAssignedPen"/>
<element name="TLazCanvas.FBaseWindowOrg"/>
<element name="TLazCanvas.PolygonNonZeroWindingRule"/>
<element name="TLazCanvas.FLazClipRegion"/>
<element name="TLazCanvas.FWindowOrg"/>

<element name="TLazCanvas.GraphicStateList">
<short>Stores saved canvas state information.</short>
<descr>
<p>
Used to store and restore canvas states in the <var>SaveState</var> and 
<var>RestoreState</var> methods. Contains <var>TLazCanvasState</var> class 
instances.
</p>
</descr>
<seealso>
<link id="TLazCanvasState"/>
<link id="TLazCanvas.SaveState"/>
<link id="TLazCanvas.RestoreState"/>
</seealso>
</element>

<element name="TLazCanvas.GetAssignedBrush">
<short>Gets the value for the AssignedBrush property.</short>
<descr/>
<seealso>
<link id="TLazCanvas.AssignedBrush"/>
</seealso>
</element>
<element name="TLazCanvas.GetAssignedBrush.Result">
<short>Value for the AssignedBrush property.</short>
</element>

<element name="TLazCanvas.GetAssignedPen">
<short>Gets the value for the AssignedPen property.</short>
<descr/>
<seealso>
<link id="TLazCanvas.AssignedPen"/>
</seealso>
</element>
<element name="TLazCanvas.GetAssignedPen.Result">
<short>Value for the AssignedPen property.</short>
</element>

<element name="TLazCanvas.GetAssignedFont">
<short>Gets the value for the AssignedFont property.</short>
<descr/>
<seealso>
<link id="TLazCanvas.AssignedFont"/>
</seealso>
</element>
<element name="TLazCanvas.GetAssignedFont.Result">
<short>Value for the AssignedFont property.</short>
</element>

<element name="TLazCanvas.GetWindowOrg">
<short>Gets the value for the WindowOrg property.</short>
<descr/>
<seealso>
<link id="TLazCanvas.WindowOrg"/>
</seealso>
</element>
<element name="TLazCanvas.GetWindowOrg.Result">
<short>Value for the WindowOrg property.</short>
</element>

<element name="TLazCanvas.SetWindowOrg">
<short>Sets the value for the WindowOrg property.</short>
<descr/>
<seealso>
<link id="TLazCanvas.WindowOrg"/>
</seealso>
</element>
<element name="TLazCanvas.SetWindowOrg.AValue">
<short>New value for the WindowOrg property.</short>
</element>

<element name="TLazCanvas.SetColor">
<short>Sets the color for the pixel at the specified coordinates.</short>
<descr/>
<seealso/>
</element>
<element name="TLazCanvas.SetColor.x">
<short>Horizontal pixel coordinate.</short>
</element>
<element name="TLazCanvas.SetColor.y">
<short>Vertical pixel coordinate.</short>
</element>
<element name="TLazCanvas.SetColor.AValue">
<short>Color for the pixel.</short>
</element>

<element name="TLazCanvas.DoCreateDefaultFont">
<short>Creates the custom font used as the default for the canvas.</short>
<descr>
<p>
<var>DoCreateDefaultFont</var> is an overridden <var>TFPCustomFont</var> 
function used to provide the default font for the canvas class instance. 
DoCreateDefaultFont implements the abstract virtual method defined in an 
ancestor class, and emulates the method defined in TCanvas.
</p>
<p>
DoCreateDefaultFont sets the <var>Size</var> property in the font to zero 
(<b>0</b>); this causes the default font size for the platform or widget set 
to be used. The <var>FPColor</var> property in the font is set to 
<var>colBlack</var>.
</p>
</descr>
<seealso/>
</element>
<element name="TLazCanvas.DoCreateDefaultFont.Result">
<short>TFPCustomFont instance created and initialized in the method.</short>
</element>

<element name="TLazCanvas.DoRectangle">
<short>
Adjusts the fcl-image coordinate system to be compatible with coordinates 
used in TCanvas.
</short>
<descr>
<p>
Adjusts the values in <var>Bounds</var> to use the coordinate system in 
<var>TCanvas</var>, and draws borders using the style and/or pattern in the 
Pen for the canvas.
</p>
<p>
<var>DoRectangleFill</var> is used to optimize and fill a rectangle area.
</p>
</descr>
<seealso>
<link id="TLazCanvas.DoRectangleFill"/>
</seealso>
</element>
<element name="TLazCanvas.DoRectangle.Bounds">
<short>TRect with the bounds for the rectangular area.</short>
</element>

<element name="TLazCanvas.DoRectangleFill">
<short>
Adjusts the FCL image rectangle to be LCL compatible and draws a filled 
rectangle on the canvas.
</short>
<descr>
<p>
<var>DoRectangleFill</var> adjusts the fcl-image coordinate system to be 
compatible with coordinates used in <var>TCanvas</var>.
</p>
<p>
It calls the FCL SortRec routine (in <file>clipping.pp</file>) to normalize 
the values in Bounds prior to the drawing operation. It also shrinks the 
rectangle by a single pixel on the bottom and right edges for the border drawn 
in the Rectangle method. The original values in Bounds are not changed though 
- a temporary copy of Bounds is used in the method.
</p>
<p>
Values in Brush, like the Color and Style properties, are used to draw the 
filled rectangle. Style determines the routine(s) called to fill the drawing 
area as follows:
</p>
<dl>
<dt>bsSolid</dt>
<dd>
Fills the specified area with the Brush color. If the rectangle covers the 
entire width and height for the canvas and Clipping is not enabled, the 
FillColor method is used. Otherwise, the FillRectangleColor method is called 
using the adjusted bounds for the canvas.
</dd>
<dt>bsPattern</dt>
<dd>
Calls FillRectanglePattern to fill the rectangle with the pattern specified 
for the Brush.
</dd>
<dt>bsImage</dt>
<dd>
Fills the rectangle with the image assigned to the Brush. Uses 
RelativeBrushImage to determine whether FillRectangleImageRel or 
FillRectangleImage is called for the operation. A PixelCanvasException 
exception is raised for the style if an image has not been assigned in Brush.
</dd>
<dt>bsBDiagonal</dt>
<dd>
Calls FillRectangleHashDiagonal to fill the rectangle using the size for the 
hash pattern.
</dd>
<dt>bsFDiagonal</dt>
<dd>
Calls FillRectangleHashBackDiagonal to fill the rectangle using the size for 
the hash pattern.
</dd>
<dt>bsCross</dt>
<dd>
Calls both FillRectangleHashHorizontal and FillRectangleHashVertical to fill 
the rectangle using the size for the hash pattern.
</dd>
<dt>bsDiagCross</dt>
<dd>
Calls booth FillRectangleHashDiagonal and FillRectangleHashBackDiagonal to 
fill the rectangle using the size for the hash pattern.
</dd>
<dt>bsHorizontal</dt>
<dd>
Calls FillRectangleHashHorizontal to fill the rectangle using the size for the 
hash pattern.
</dd>
<dt>bsVertical</dt>
<dd>
Calls FillRectangleHashVertical to fill the rectangle using the size for the 
hash pattern.
</dd>
</dl>
<p>
DoRectangleFill is an overridden method in TLazCanvas. It reimplements the 
method introduced in the TFPPixelCanvas ancestor (in FCL), and does <b>not</b> 
call the inherited method.
</p>
</descr>
<vesion>
Modified in LCL version 3.0 to decrease the bottom and right edges of the 
rectangle by a single pixel. This fixes a difference between the rectangle 
fill and a border drawn in the Rectangle method.
</vesion>
<seealso/>
</element>
<element name="TLazCanvas.DoRectangleFill.Bounds">
<short>Rectangle with the bounds adjusted and used in the method.</short>
</element>

<element name="TLazCanvas.DoPolygonFill">
<short>
Implements a polygon fill algorithm not present in fcl-image prior to FPC 
version 3.2.3.
</short>
<descr>
<p>
Implements a polygon fill algorithm not present in fcl-image. Part of the 
algorithm is explained 
<url href="http://alienryderflex.com/polygon_fill/">here</url>.
</p>
<p>
DoPolygonFill is defined when using FPC versions prior to 3.2.3. In FPC 3.2.3, 
the method already exists in the TFPPixelCanvas ancestor and is not needed in 
TLazCanvas.
</p>
</descr>
<version>
Modified in LCL versions after 2.2.4 to call DrawPixel instead of SetColor 
when drawing pixels between points on the polygon. This allows the DrawingMode 
(opacity, alphablending, custom) to be applied to the pixels. Adds support for 
the non-zero winding rule in the fill operation.
</version>
<seealso>
<link id="TLazCanvas.AlphaBlend"/>
<link id="TLazCanvas.SetColor"/>
</seealso>
</element>
<element name="TLazCanvas.DoPolygonFill.points">
<short>Array with the TPoint records representing the polygon vertices.</short>
</element>

<element name="TLazCanvas.DoLine">
<short>
Draws a line using the specified coordinates and Pen for the canvas.
</short>
<descr/>
<seealso/>
</element>
<element name="TLazCanvas.DoLine.x1">
<short>Initial horizontal coordinate for the line.</short>
</element>
<element name="TLazCanvas.DoLine.y1">
<short>Initial vertical coordinate for the line.</short>
</element>
<element name="TLazCanvas.DoLine.x2">
<short>Terminal horizontal coordinate for the line.</short>
</element>
<element name="TLazCanvas.DoLine.y2">
<short>Terminal vertical coordinate for the line.</short>
</element>

<element name="TLazCanvas.DoCopyRect">
<short>
Performs actions needed to copy a source rectangle from the specified canvas.
</short>
<descr>
<p>
<var>DoCopyRect</var> is an overridden method in <var>TLazCanvas</var>. It is 
used to copy values from the specified source rectangle in the Canvas argument 
to the location specified in X and Y. DoCopyRect reimplements the method from 
an ancestor class (TFPPixelCanvas).
</p>
<p>
<var>X</var> and <var>Y</var> contain the left, top coordinates on the Lazarus 
canvas where the copied values are stored.
</p>
<p>
<var>Canvas</var> is the TFPCustomCanvas instance with the values for the 
SourceRect argument.
</p>
<p>
<var>SourceRect</var> is the TRect instance width the Left, Top, Right and 
Bottom coordinates for the rectangular region copied from Canvas.
</p>
<p>
DoCopyRect calls the CanvasCopyRect method to perform the actions needed to 
perform the copy operation using the specified arguments.
</p>
</descr>
<seealso>
<link id="TLazCanvas.CanvasCopyRect"/>
</seealso>
</element>
<element name="TLazCanvas.DoCopyRect.x">
<short>
Left coordinate where the copied values are stored on the Lazarus canvas.
</short>
</element>
<element name="TLazCanvas.DoCopyRect.y">
<short>
Top coordinate where the copied values are stored on the Lazarus canvas.
</short>
</element>
<element name="TLazCanvas.DoCopyRect.canvas">
<short>
Canvas instance that is the source for the values copied in the method.
</short>
</element>
<element name="TLazCanvas.DoCopyRect.SourceRect">
<short>
TRect instance with the Canvas coordinates copied in the method.
</short>
</element>

<element name="TLazCanvas.DoDraw">
<short>
Performs actions needed to draws the specified image at the given coordinates 
using AlphaBlending.
</short>
<descr>
<p>
<var>DoDraw</var> is an overridden method in <var>TLazCanvas</var>. It 
reimplements the method from an ancestor class (TFPixelCanvas), and calls the 
AlphaBlend_Image method to draw the specified image at the given position.
</p>
<p>
<var>X</var> and <var>Y</var> contain the left and top coordinates on the 
Lazarus canvas where the image is drawn.
</p>
<p>
<var>AImage</var> is the TFPCustomImage instance drawn at the specified 
position.
</p>
<p>
DoDraw is used to implement the DoDrawImage method.
</p>
</descr>
<seealso>
<link id="TLazCanvas.AlphaBlend_Image"/>
</seealso>
</element>
<element name="TLazCanvas.DoDraw.x">
<short>
Left coordinate on the Lazarus canvas where the specified image is drawn.
</short>
</element>
<element name="TLazCanvas.DoDraw.y">
<short>
Top coordinate on the Lazarus canvas where the specified image is drawn.
</short>
</element>
<element name="TLazCanvas.DoDraw.AImage">
<short>
Image drawn on the Lazarus canvas at the specified position.
</short>
</element>

<element name="TLazCanvas.HasNoImage">
<short>Indicates if a valid image was provided in the constructor.</short>
<descr>
<p>
<var>HasNoImage</var> is a <var>Boolean</var> member used to indicate if a 
valid <var>TFPCustomImage</var> was provided as an argument to the 
<var>Create</var> constructor. Used in the implementation of the 
<var>UpdateControlLazImageAndCanvas</var> routine for non-native custom drawn 
window controls.
</p>
</descr>
<seealso>
<link id="TLazCanvas.Create"/>
</seealso>
</element>

<element name="TLazCanvas.NativeDC">
<short>Native device context for the canvas.</short>
<descr>
<p>
<var>NativeDC</var> is a <var>PtrInt</var> member which contains the device 
context used to render a custom-drawn LCL control.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvas.ExtraFontData">
<short>
Member with extra FreeType font data from the canvas or device context.
</short>
<descr>Used in custom-drawn LCL controls.</descr>
<seealso/>
</element>

<element name="TLazCanvas.ImageFormat">
<short>
Member with the TLazCanvasImageFormat instance used to speed up drawing.
</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvas.SelectedBitmap">
<short>Member with the GDI Handle for an image.</short>
<descr>Used in custom-drawn LCL controls.</descr>
<seealso/>
</element>

<element name="TLazCanvas.Create">
<short>Constructor for the class instance.</short>
<descr>
<p>
<var>Create</var> is the constructor for the class instance. Create calls the 
inherited constructor using <var>AnImage</var> as an argument.
</p>
<p>
Create allocates resources for the <var>GraphicStateList</var> property. 
Create sets the value for the <var>HasNoImage</var> member to <b>True</b> 
when <var>AnImage</var> has not been assigned (contains <b>Nil</b>).
</p>
</descr>
<seealso>
<link id="TLazCanvas.HasNoImage"/>
</seealso>
</element>
<element name="TLazCanvas.Create.AnImage">
<short>Screen image for the control rendered on the canvas.</short>
</element>

<element name="TLazCanvas.Destroy">
<short>Destructor for the class instance.</short>
<descr>
<p>
<var>Destroy</var> is the overridden destructor for the class instance. 
Destroy ensures that resources allocated for <var>GraphicStateList</var>, 
<var>AssignedBrush</var>, and <var>AssignedPen</var> are freed. Destroy calls 
the inherited destructor prior to exiting from the method.
</p>
</descr>
<seealso>
<link id="TLazCanvas.AssignedBrush"/>
<link id="TLazCanvas.AssignedPen"/>
</seealso>
</element>

<element name="TLazCanvas.SetLazClipRegion">
<short>Sets the value in the ClipRegion property.</short>
<descr/>
<seealso/>
</element>
<element name="TLazCanvas.SetLazClipRegion.ARegion">
<short>Region stored in the property.</short>
</element>

<element name="TLazCanvas.SaveState">
<short>Saves the current canvas state in the GraphicStateList member.</short>
<descr>
<p>
<var>SaveState</var> is an <var>Integer</var> function used to save the 
current canvas state in the <var>GraphicStateList</var> member. SaveState 
creates an instance of <var>TLazCanvasState</var> with copies of the current 
values for <var>Brush</var>, <var>Pen</var>, and <var>Font</var>. Values from 
<var>BaseWindowOrg</var>, <var>WindowOrg</var>, and <var>Clipping</var> are 
also assigned to the class instance.
</p>
<p>
The return value contains the ordinal position in <var>GraphicStateList</var> 
where the canvas state was added in the method.
</p>
<p>
Use <var>RestoreState</var> to restore the canvas to the state stored at a 
specified position in the list.
</p>
</descr>
<seealso>
<link id="TLazCanvas.AssignedBrush"/>
<link id="TLazCanvas.AssignedPen"/>
<link id="TLazCanvas.AssignedFont"/>
<link id="TLazCanvas.BaseWindowOrg"/>
<link id="TLazCanvas.WindowOrg"/>
<link id="TLazCanvas.RestoreState"/>
</seealso>
</element>
<element name="TLazCanvas.SaveState.Result">
<short>
Ordinal position in GraphicStateList where the saved canvas state was stored.
</short>
</element>

<element name="TLazCanvas.RestoreState">
<short>
Restores the canvas to the state stored at the specified position.
</short>
<descr/>
<seealso/>
</element>
<element name="TLazCanvas.RestoreState.AIndex">
<short>Ordinal position in GraphicStateList restored in the method.</short>
</element>

<element name="TLazCanvas.ResetCanvasState">
<short>
Sets the canvas to the default values/state used in the LCL TCanvas class.
</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvas.AlphaBlend">
<short>
Alpha blends the specified content from the source canvas onto the canvas 
instance.
</short>
<descr>
<p>
<var>AlphaBlend</var> combines the content in <var>ASource</var> with the 
current class instance to create the appearance of an image with partial or 
full transparency. The current class instance provides the background for the 
combined content.
</p>
<p>
<var>ADestX</var> and <var>ADestY</var> provides the left and top coordinates 
where the content from ASource is overlayed.
</p>
<p>
<var>ASourceX</var>, <var>ASourceY</var>, <var>ASourceWidth</var> and <var>
ASourceHeight</var> contain the coordinates and dimensions for the image area 
retrieved from the ASource canvas.
</p>
<p>
AlphaBlend ensures that the specified source content is not too large for the 
destination area. The dimensions in ASourceWidth and ASourceHeight are 
adjusted if any part of the image is outside the destination area.
</p>
<p>
AlphaBlend creates an inverse mask for the alpha channel used on the pixels in 
ASource. The mask is applied to the RGB components for the Colors in the 
current class instance. The alpha channel in Colors is set to alphaOpaque for 
the combined content.
</p>
<p>
AlphaBlend is used in the implementation of the AlphaBlend_Image method.
</p>
<p>
<b>Topics of Interest (but not documented in FCL)</b>
</p>
<ul>
<li>TFPCustomCanvas.Colors (in <file>fpcanvas.pp</file>)</li>
<li>TFPImageCanvas (in <file>fpimgcanv.pp</file>)</li>
<li>TFPColor (in <file>fpimage.pp</file>)</li>
</ul>
</descr>
<seealso>
<link id="TLazCanvas.AlphaBlend_Image"/>
<link id="TLazCanvas.AlphaBlendIgnoringDestPixels"/>
</seealso>
</element>
<element name="TLazCanvas.AlphaBlend.ASource">
<short>
Lazarus canvas with the content alpha blended onto the current class instance.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ADestX">
<short>
Left coordinate where the content in ASource is applied.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ADestY">
<short>
Top coordinate where the content in ASource is applied.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ASourceX">
<short>
Left coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ASourceY">
<short>
Top coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ASourceWidth">
<short>
Width (in pixels) of the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend.ASourceHeight">
<short>
Height (in pixels) of the content in ASource applied in the method.
</short>
</element>

<element name="TLazCanvas.AlphaBlendIgnoringDestPixels">
<short>Performs an AlphaBlend operation assuming a white background.</short>
<descr>
<p>
This is a safer version for use where the destination pixels may not be 
consistent or valid. It will draw as if the target area contained opaque 
white pixels.
</p>
</descr>
<seealso>
<link id="TLazCanvas.AlphaBlend"/>
</seealso>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ASource">
<short>
Lazarus canvas with the content alpha blended onto the current class instance.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ADestX">
<short>
Left coordinate where the content in ASource is applied.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ADestY">
<short>
Top coordinate where the content in ASource is applied.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ASourceX">
<short>
Left coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ASourceY">
<short>
Top coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ASourceWidth">
<short>
Width (in pixels) of the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlendIgnoringDestPixels.ASourceHeight">
<short>
Height (in pixels) of the content in ASource applied in the method.
</short>
</element>

<element name="TLazCanvas.AlphaBlend_Image">
<short>AlphaBlends the specified image onto the canvas.</short>
<descr/>
<seealso>
<link id="TLazCanvas.AlphaBlend"/>
<link id="TLazCanvas.AlphaBlendIgnoringDestPixels"/>
</seealso>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ASource">
<short>
TFPCustomImage instance with the content applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ADestX">
<short>
Left coordinate where the content in ASource is applied to the canvas.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ADestY">
<short>
Top coordinate where the content in ASource is applied to the canvas.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ASourceX">
<short>
Left coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ASourceY">
<short>
Top coordinate for the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ASourceWidth">
<short>
Width (in pixels) of the content in ASource applied in the method.
</short>
</element>
<element name="TLazCanvas.AlphaBlend_Image.ASourceHeight">
<short>
Height (in pixels) of the content in ASource applied in the method.
</short>
</element>

<element name="TLazCanvas.DoDrawImage">
<short>
Calls DoDraw for the specified image and coordinates.
</short>
<descr/>
<seealso>
<link id="TLazCanvas.DoDraw"/>
</seealso>
</element>
<element name="TLazCanvas.DoDrawImage.x">
<short>
Left coordinate where the specified image is drawn on the Lazarus canvas.
</short>
</element>
<element name="TLazCanvas.DoDrawImage.y">
<short>
Top coordinate where the specified image is drawn on the Lazarus canvas.
</short>
</element>
<element name="TLazCanvas.DoDrawImage.AImage">
<short>
TFPCustomImage instance with the content rendered to the canvas.
</short>
</element>

<element name="TLazCanvas.CanvasCopyRect">
<short>
Copies the contents of a supported image format in ASource to the canvas.
</short>
<descr/>
<seealso>
<link id="TLazCanvas.DoCopyRect"/>
</seealso>
</element>

procedure CanvasCopyRect(ASource: TFPCustomCanvas; 
  const ADestX, ADestY, ASourceX, ASourceY, 
  ASourceWidth, ASourceHeight: Integer);

<element name="TLazCanvas.CanvasCopyRect.ASource">
<short>
TFPCustomCanvas instance with the content copied in the method.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ADestX">
<short>
Left coordinate on the canvas where the content in ASource is copied.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ADestY">
<short>
Top coordinate on the canvas where the content in ASource is copied.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ASourceX">
<short>
Left coordinate for the content in ASource copied in the method.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ASourceY">
<short>
Top coordinate for the content in ASource copied in the method.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ASourceWidth">
<short>
Width (in pixels) for the content in ASource copied in the method.
</short>
</element>
<element name="TLazCanvas.CanvasCopyRect.ASourceHeight">
<short>
Height (in pixels) for the content in ASource copied in the method.
</short>
</element>

<element name="TLazCanvas.FillColor">
<short>Fills the entire drawing area with the specified color.</short>
<descr>
<p>
Fills the entire drawing area with the specified color. 
<var>AIgnoreClippingAndWindowOrg</var> speeds up canvas drawing operations, 
but it is dangerous; don't use it unless you know what you are doing.
</p>
</descr>
<seealso/>
</element>
<element name="TLazCanvas.FillColor.AColor">
<short>Color applied to the canvas area.</short>
</element>
<element name="TLazCanvas.FillColor.AIgnoreClippingAndWindowOrg">
<short>
<b>True</b> ignores the canvas clipping region and window origin, and fills 
all pixels for an underlying Image with the specified color. <b>False</b> (the 
default) limits the scope to the Width and Height for the canvas - not the 
range of pixels in the Image.
</short>
</element>

<element name="TLazCanvas.Polygon">
<short>
Overloaded method which adds support for the non-zero winding rule.
</short>
<descr>
<p>
<var>Polygon()</var> overloads an equally-named method inherited from <var>TFPCustomCanvas</var> 
which
fills a polygon via <var>DoPolygonFill()</var>. 
By default, the even-odd rule is applied for filling. 
The current overload, however, adds support for filling the polygon 
by the <url href="https://en.wikipedia.org/wiki/Nonzero-rule/">non-zero winding rule</url>.
</p>
<p>
In each case, the polygon is filled by drawing horizontal lines across the polygon 
starting at the left 
The intersection points of this line with the polygon segments are calculated 
and sorted from left to right. 
</p>
<p>
In the even-odd rule, lines are drawn between adjacent intersection points in 
an alternating way. 
</p>
<p>
In the non-zero winding rule the "winding number"
(starting at zero for each line) is incremented/decremented depending on whether
the hit polygon segment is oriented upward or downward.
The following line segment is drawn only when the accumulated winding number 
is not zero.
</p>
<p>
The non-zero winding rule is selected when the <var>Winding</var> argument of the 
method is <b>true</b>. 
Otherwise the even-odd rule is applied.
</p>
<p>
The <var>DrawPixel()</var> method is called along the filling lines in order to apply the 
brush color to the canvas pixels in an either opaque or semi-transparent way.
</p>
</descr>
<version>
Added in LCL version 3.0.
</version>
<seealso/>
</element>
<element name="TLazCanvas.Polygon.Points">
<short>
Array with the TPoint instances for the vertices on the polygon.
</short>
</element>
<element name="TLazCanvas.Polygon.Winding">
<short>
<b>True</b> if the non-zero winding rule is enabled for the canvas instance.
Otherwise the polygon is filled by means of the "even-odd" rule in which 
alternating horizontal lines are drawn between pairs of polygon intersection 
points.
</short>
</element>

<element name="TLazCanvas.AssignPenData">
<short>Sets the Pen data for the canvas.</short>
<descr>
<p>
Utilized by <var>LCLIntf.SelectObject</var> and by the 
<var>RestoreState</var> method. This is needed because calling 
<var>Assign</var> for the <var>Pen</var>, <var>Brush</var>, or 
<var>Font</var> properties raises exceptions.
</p>
</descr>
<seealso/>
</element>
<element name="TLazCanvas.AssignPenData.APen">
<short>Pen data stored in the method.</short>
</element>

<element name="TLazCanvas.AssignBrushData">
<short>Sets the Brush data for the canvas.</short>
<descr>
<p>
Utilized by <var>LCLIntf.SelectObject</var> and by the 
<var>RestoreState</var> method. This is needed because calling 
<var>Assign</var> for the <var>Pen</var>, <var>Brush</var>, or 
<var>Font</var> properties raises exceptions.
</p>
</descr>
<seealso/>
</element>
<element name="TLazCanvas.AssignBrushData.ABrush">
<short>Brush data stored in the method.</short>
</element>

<element name="TLazCanvas.AssignFontData">
<short>Sets the Font data for the canvas.</short>
<descr>
<p>
AssignFontData copies property values in AFont to the Font for class instance, 
including:
</p>
<ul>
<li>FPColor</li>
<li>Name</li>
<li>Size</li>
<li>Bold</li>
<li>Italic</li>
<li>Underline</li>
<li>Strikethrough</li>
</ul>
<p>
No actions are performed in the method if AFont has not been assigned 
(contains <b>Nil</b>.
</p>
<p>
Utilized by <var>LCLIntf.SelectObject</var> and by the 
<var>RestoreState</var> method. This is needed because calling 
<var>Assign</var> for the <var>Pen</var>, <var>Brush</var>, or 
<var>Font</var> properties raises exceptions.
</p>
</descr>
<seealso/>
</element>
<element name="TLazCanvas.AssignFontData.AFont">
<short>
TFPCustomFont instance with the attributes assigned to the Font for the canvas.
</short>
</element>

<element name="TLazCanvas.AssignedPen">
<short>Pen assigned to the canvas.</short>
<descr>
<p>
These properties are utilized to implement <var>LCLIntf.SelectObject</var> to 
keep track of which pen/brush/font handle was assigned to this canvas. They 
are not utilized by <var>TLazCanvas</var> itself.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvas.AssignedBrush">
<short>Brush assigned to the canvas.</short>
<descr>
<p>
These properties are used to implement <var>LCLIntf.SelectObject</var> to 
keep track of which pen/brush/font handle was assigned to this canvas. They 
are not utilized by <var>TLazCanvas</var> itself.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvas.AssignedFont">
<short>Font assigned to the canvas.</short>
<descr>
<p>
These properties are used to implement <var>LCLIntf.SelectObject</var> to 
keep track of which pen/brush/font handle was assigned to this canvas. They 
are not utilized by <var>TLazCanvas</var> itself.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvas.BaseWindowOrg">
<short>Base window origin for the canvas.</short>
<descr>
<p>
The values in <var>WindowOrg</var> are relative to the coordinates in 
<var>BaseWindowOrg</var>. BaseWindowOrg coordinates are relative to the 
canvas for the containing Form. It is useful when implementing the non-native 
windowed controls.
</p>
</descr>
<seealso/>
</element>

<element name="TLazCanvas.ClipRegion">
<short>Clipping region for the canvas.</short>
<descr/>
<seealso/>
</element>

<element name="TLazCanvas.WindowOrg">
<short>Window origin for the canvas.</short>
<descr>
<p>
Contains the absolute coordinates for the canvas with 
<var>BaseWindowOrg</var> summed up.
</p>
</descr>
<seealso/>
</element>

</module>
<!-- LazCanvas -->
</package>
</fpdoc-descriptions>