📄 dgallery.pas
字号:
Path.AddLine(PointByName('bottom').X, PointByName('bottom').Y, PointByName('left').X, PointByName('left').Y);
Path.AddLine(PointByName('left').X, PointByName('left').Y, PointByName('top').X, PointByName('top').Y);
Path.CloseFigure;
G.FillPath(B, Path);
G.DrawPath(P, Path);
Path.Free;
B.Free;
P.Free;
end;
{ ProceduredBlock }
constructor ProceduredBlock.Create(AOwner: TComponent);
var
P: BlockPoint;
begin
inherited;
P := BlockPoint(Points.Add);
P.Kind := pkBlockSnapPoint;
P.X := 0.5;
P.Y := 0.5;
end;
destructor ProceduredBlock.Destroy;
begin
inherited;
end;
procedure ProceduredBlock.DrawBlock(G: TGPGraphics);
var
P: TGPPen;
B: TGPBrush;
Path: TGPGraphicsPath;
begin
P := Stroke.GetPen;
B := Fill.GetBrush(PointXByName('lefttop'), PointYByName('lefttop'), PointXByName('rightbottom'), PointYByName('rightbottom'));
Path := TGPGraphicsPath.Create;
if Assigned(FDrawProc) then
FDrawProc(Path, Width, Height);
G.FillPath(B, Path);
G.DrawPath(P, Path);
Path.Free;
B.Free;
P.Free;
end;
{ Arrow1 }
constructor Arrow1.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrow1;
end;
{ Arrow2 }
constructor Arrow2.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrow2;
end;
{ Arrow3 }
constructor Arrow3.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrow3;
end;
{ Arrow4 }
constructor Arrow4.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrow4;
end;
{ Arrow5 }
constructor Arrow5.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrow5;
end;
{ CurvedArrow }
constructor CurvedArrow.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawArrowCurve;
end;
{ HalfCircle }
constructor HalfCircle.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawHalfCircle;
end;
{ Pentagon }
constructor Pentagon.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPentagon;
end;
{ Hexagon }
constructor Hexagon.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawHexagon;
end;
{ Heptagon }
constructor Heptagon.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawHeptagon;
end;
{ Cross }
constructor Cross.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawCross2;
end;
{ LineStar }
constructor LineStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawLineStar;
end;
{ ThreeStar }
constructor ThreeStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := Draw3Star;
end;
{ FourStar }
constructor FourStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := Draw4Star;
end;
{ FiveStar }
constructor FiveStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := Draw5Star;
end;
{ SixStar }
constructor SixStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := Draw6Star;
end;
{ EightStar }
constructor EightStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := Draw8Star;
end;
{ BigStar }
constructor BigStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawManyStar
end;
{ RoundStar }
constructor RoundStar.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawRound4Star;
end;
{ Pyramid }
constructor Pyramid.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPyramid;
end;
{ Ladder }
constructor Ladder.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawLadder;
end;
{ Hex3D }
constructor Hex3D.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawHex3D;
end;
{ Mailbox }
constructor Mailbox.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawMailbox;
end;
{ Triangle3D }
constructor Triangle3D.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawTriangle3D;
end;
{ Dector3D }
constructor Sector3D.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawSector3D;
end;
{ Cube }
constructor Cube.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawCube;
end;
{ Torus }
constructor Torus.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawTorus;
end;
{ Cylinder }
constructor Cylinder.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawCylinder
end;
{ Brush }
constructor Brush.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawBrush
end;
{ Pen }
constructor Pen.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPen
end;
{ Shears }
constructor Shears.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawShears
end;
{ Phone }
constructor Phone.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPhone
end;
{ Paper }
constructor Paper.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPaper
end;
{ Recycled }
constructor Recycled.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawRecycled
end;
{ Mouse }
constructor Mouse.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawMouse
end;
{ Printer }
constructor Printer.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPrinter
end;
{ Computer }
constructor Computer.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawComputer
end;
{ Keyboard }
constructor Keyboard.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawKeyboard
end;
{ Hand }
constructor Hand.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawHand
end;
{ ChartDocument }
constructor ChartDocument.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawDocument
end;
{ ChartData }
constructor ChartData.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawData
end;
{ ChartDirectData }
constructor ChartDirectData.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawDirectData
end;
{ ChartSequentialData }
constructor ChartSequentialData.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawSequentialData
end;
{ ChartManualInput }
constructor ChartManualInput.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawManualInput
end;
{ ChartManualOperation }
constructor ChartManualOperation.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawManualOperation
end;
{ ChartOffPageRef }
constructor ChartOffPageRef.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawOffPageRef
end;
{ ChartDisplay }
constructor ChartDisplay.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawDisplay
end;
{ ChartStoredData }
constructor ChartStoredData.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawStoredData
end;
{ ChartPaperTape }
constructor ChartPaperTape.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPaperTape
end;
{ ChartPreparation }
constructor ChartPreparation.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawPreparation
end;
{ ChartCard }
constructor ChartCard.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawCard
end;
{ ChartTerminator }
constructor ChartTerminator.Create(AOwner: TComponent);
begin
inherited;
DrawProc := DrawTerminator
end;
initialization
RegisterClasses([Arrow1,Arrow2,Arrow3,Arrow4,Arrow5,CurvedArrow]);
RegisterClasses([Triangle,RightTriangle,Diamond,HalfCircle,Pentagon,Hexagon,Heptagon,Cross,LineStar,ThreeStar,FourStar,FiveStar,EightStar,BigStar,RoundStar]);
RegisterClasses([Pyramid,Ladder,Hex3D,Mailbox,Triangle3D,Sector3D,Cube,Torus,Cylinder]);
RegisterClasses([Brush,Pen,Shears,Phone,Paper,Recycled,Mouse,Printer,Hand,Keyboard,Computer]);
RegisterClasses([ChartDocument,ChartData,ChartDirectData,ChartSequentialData,ChartManualInput,ChartManualOperation,ChartOffPageRef,ChartDisplay,ChartStoredData,ChartPaperTape,ChartPreparation,ChartCard,ChartTerminator]);
finalization
UnregisterClasses([Arrow1,Arrow2,Arrow3,Arrow4,Arrow5,CurvedArrow]);
UnregisterClasses([Triangle,RightTriangle,Diamond,HalfCircle,Pentagon,Hexagon,Heptagon,Cross,LineStar,ThreeStar,FourStar,FiveStar,EightStar,BigStar,RoundStar]);
UnregisterClasses([Pyramid,Ladder,Hex3D,Mailbox,Triangle3D,Sector3D,Cube,Torus,Cylinder]);
UnregisterClasses([Brush,Pen,Shears,Phone,Paper,Recycled,Mouse,Printer,Hand,Keyboard,Computer]);
UnregisterClasses([ChartDocument,ChartData,ChartDirectData,ChartSequentialData,ChartManualInput,ChartManualOperation,ChartOffPageRef,ChartDisplay,ChartStoredData,ChartPaperTape,ChartPreparation,ChartCard,ChartTerminator]);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -