You've already forked lazarus-ccr
Basic implementation of the fpvectorial viewer
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1447 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,8 +1,87 @@
|
|||||||
object Form1: TForm1
|
object frmFPVViewer: TfrmFPVViewer
|
||||||
Left = 349
|
Left = 234
|
||||||
Height = 240
|
Height = 433
|
||||||
Top = 171
|
Top = 172
|
||||||
Width = 320
|
Width = 342
|
||||||
Caption = 'Form1'
|
Caption = 'frmFPVViewer'
|
||||||
|
ClientHeight = 433
|
||||||
|
ClientWidth = 342
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
|
object editFileName: TFileNameEdit
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 8
|
||||||
|
Width = 304
|
||||||
|
DialogOptions = []
|
||||||
|
FilterIndex = 0
|
||||||
|
HideDirectories = False
|
||||||
|
ButtonWidth = 23
|
||||||
|
NumGlyphs = 0
|
||||||
|
MaxLength = 0
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object btnVisualize: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 40
|
||||||
|
Width = 96
|
||||||
|
Caption = 'Visualize'
|
||||||
|
OnClick = btnVisualizeClick
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object spinScale: TFloatSpinEdit
|
||||||
|
Left = 72
|
||||||
|
Height = 25
|
||||||
|
Top = 72
|
||||||
|
Width = 64
|
||||||
|
Increment = 1
|
||||||
|
MaxValue = 100
|
||||||
|
MinValue = 0
|
||||||
|
TabOrder = 2
|
||||||
|
Value = 1
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 18
|
||||||
|
Top = 79
|
||||||
|
Width = 61
|
||||||
|
Caption = 'Scale by:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object imageView: TImage
|
||||||
|
Left = 11
|
||||||
|
Height = 296
|
||||||
|
Top = 128
|
||||||
|
Width = 325
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 18
|
||||||
|
Top = 104
|
||||||
|
Width = 82
|
||||||
|
Caption = 'Start Pos X:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object spinStartX: TSpinEdit
|
||||||
|
Left = 98
|
||||||
|
Height = 25
|
||||||
|
Top = 99
|
||||||
|
Width = 46
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object spinStartY: TSpinEdit
|
||||||
|
Left = 240
|
||||||
|
Height = 25
|
||||||
|
Top = 99
|
||||||
|
Width = 50
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 152
|
||||||
|
Height = 18
|
||||||
|
Top = 104
|
||||||
|
Width = 79
|
||||||
|
Caption = 'Start Pos Y:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,10 +5,24 @@ unit fpvv_mainform;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, EditBtn,
|
||||||
|
StdCtrls, Spin, ExtCtrls;
|
||||||
|
|
||||||
type
|
type
|
||||||
TForm1 = class(TForm)
|
|
||||||
|
{ TfrmFPVViewer }
|
||||||
|
|
||||||
|
TfrmFPVViewer = class(TForm)
|
||||||
|
btnVisualize: TButton;
|
||||||
|
editFileName: TFileNameEdit;
|
||||||
|
imageView: TImage;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
spinStartX: TSpinEdit;
|
||||||
|
spinStartY: TSpinEdit;
|
||||||
|
spinScale: TFloatSpinEdit;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure btnVisualizeClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -16,11 +30,36 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
Form1: TForm1;
|
frmFPVViewer: TfrmFPVViewer;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
fpvectorial, cdrvectorialreader, svgvectorialwriter, pdfvectorialreader,
|
||||||
|
dxfvectorialreader,
|
||||||
|
fpvtocanvas;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TfrmFPVViewer }
|
||||||
|
|
||||||
|
procedure TfrmFPVViewer.btnVisualizeClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Vec: TvVectorialDocument;
|
||||||
|
begin
|
||||||
|
// First check the in input
|
||||||
|
//if not CheckInput() then Exit;
|
||||||
|
|
||||||
|
Vec := TvVectorialDocument.Create;
|
||||||
|
try
|
||||||
|
Vec.ReadFromFile(editFileName.FileName, vfDXF);
|
||||||
|
imageView.Canvas.Brush.Color := clWhite;
|
||||||
|
imageView.Canvas.FillRect(0, 0, imageView.Width, imageView.Height);
|
||||||
|
DrawFPVectorialToCanvas(Vec, imageView.Canvas, spinStartX.Value, spinStartY.Value, spinScale.Value, spinScale.Value);
|
||||||
|
finally
|
||||||
|
Vec.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -34,30 +34,207 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="2">
|
<Units Count="8">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="fpvviewer.lpr"/>
|
<Filename Value="fpvviewer.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="fpvviewer"/>
|
<UnitName Value="fpvviewer"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="21"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="fpvv_mainform.pas"/>
|
<Filename Value="fpvv_mainform.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="Form1"/>
|
<ComponentName Value="frmFPVViewer"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fpvv_mainform"/>
|
<UnitName Value="fpvv_mainform"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="26"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<CursorPos X="80" Y="58"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="21"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="fpvectorial.pas"/>
|
||||||
|
<UnitName Value="fpvectorial"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="23"/>
|
||||||
|
<CursorPos X="35" Y="44"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<UnitName Value="fpvtocanvas"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="54"/>
|
||||||
|
<CursorPos X="1" Y="73"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="dxfvectorialreader.pas"/>
|
||||||
|
<UnitName Value="dxfvectorialreader"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="184"/>
|
||||||
|
<CursorPos X="16" Y="221"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="../../../lazarus/lcl/include/spinedit.inc"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="118"/>
|
||||||
|
<CursorPos X="1" Y="145"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="../../../lazarus/lcl/include/wincontrol.inc"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="7144"/>
|
||||||
|
<CursorPos X="1" Y="7165"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="../../../lazarus/lcl/include/customimage.inc"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="34"/>
|
||||||
|
<CursorPos X="1" Y="66"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
|
</Unit7>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="0" HistoryIndex="-1"/>
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="../../../lazarus/lcl/include/spinedit.inc"/>
|
||||||
|
<Caret Line="145" Column="1" TopLine="118"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="48" Column="1" TopLine="28"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="49" Column="1" TopLine="28"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="51" Column="1" TopLine="28"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="53" Column="1" TopLine="28"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="56" Column="1" TopLine="28"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="58" Column="1" TopLine="28"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="61" Column="1" TopLine="29"/>
|
||||||
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="63" Column="1" TopLine="31"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="61" Column="1" TopLine="31"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="63" Column="1" TopLine="31"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="66" Column="1" TopLine="34"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="67" Column="1" TopLine="35"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="70" Column="1" TopLine="38"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="71" Column="1" TopLine="39"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="69" Column="1" TopLine="39"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="56" Column="1" TopLine="39"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="58" Column="1" TopLine="39"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="61" Column="1" TopLine="39"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="63" Column="1" TopLine="39"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="61" Column="1" TopLine="39"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="63" Column="1" TopLine="39"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="66" Column="1" TopLine="39"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="67" Column="1" TopLine="39"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="dxfvectorialreader.pas"/>
|
||||||
|
<Caret Line="221" Column="16" TopLine="184"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="fpvtocanvas.pas"/>
|
||||||
|
<Caret Line="64" Column="11" TopLine="43"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="fpvv_mainform.pas"/>
|
||||||
|
<Caret Line="54" Column="52" TopLine="22"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="fpvv_mainform.pas"/>
|
||||||
|
<Caret Line="55" Column="52" TopLine="23"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="fpvv_mainform.pas"/>
|
||||||
|
<Caret Line="56" Column="52" TopLine="24"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="fpvv_mainform.pas"/>
|
||||||
|
<Caret Line="57" Column="52" TopLine="25"/>
|
||||||
|
</Position30>
|
||||||
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="9"/>
|
<Version Value="9"/>
|
||||||
|
@ -14,7 +14,7 @@ uses
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TForm1, Form1);
|
Application.CreateForm(TfrmFPVViewer, frmFPVViewer);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user