fpvviewer: Adds a new button to show the page border, requires lazarus rev 44400 plus

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2903 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2014-03-10 21:49:26 +00:00
parent 19bb4e4d40
commit a05c182b2c
3 changed files with 37 additions and 19 deletions

View File

@ -82,7 +82,7 @@ object frmFPVViewer: TfrmFPVViewer
TabOrder = 1
object editFileName: TFileNameEdit
Left = 8
Height = 23
Height = 22
Top = 8
Width = 304
DialogOptions = []
@ -104,7 +104,7 @@ object frmFPVViewer: TfrmFPVViewer
end
object spinScale: TFloatSpinEdit
Left = 72
Height = 23
Height = 16
Top = 97
Width = 168
DecimalPlaces = 6
@ -117,9 +117,9 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label1: TLabel
Left = 8
Height = 15
Height = 16
Top = 97
Width = 46
Width = 55
Caption = 'Scale by:'
ParentColor = False
end
@ -161,15 +161,15 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label2: TLabel
Left = 8
Height = 15
Height = 16
Top = 72
Width = 73
Width = 88
Caption = 'Y adjustment:'
ParentColor = False
end
object spinAdjustY: TSpinEdit
Left = 80
Height = 23
Height = 16
Top = 72
Width = 72
Increment = 100
@ -180,7 +180,7 @@ object frmFPVViewer: TfrmFPVViewer
end
object spinAdjustX: TSpinEdit
Left = 232
Height = 23
Height = 16
Top = 72
Width = 72
Increment = 50
@ -191,9 +191,9 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label3: TLabel
Left = 160
Height = 15
Height = 16
Top = 72
Width = 73
Width = 88
Caption = 'X adjustment:'
ParentColor = False
end
@ -208,18 +208,18 @@ object frmFPVViewer: TfrmFPVViewer
end
object Label4: TLabel
Left = 9
Height = 15
Height = 16
Top = 126
Width = 128
Width = 153
Caption = 'Force encoding on read:'
ParentColor = False
end
object comboEncoding: TComboBox
Left = 144
Height = 23
Height = 20
Top = 126
Width = 128
ItemHeight = 15
ItemHeight = 0
ItemIndex = 0
Items.Strings = (
'Read from the file'
@ -255,22 +255,22 @@ object frmFPVViewer: TfrmFPVViewer
end
object labelFileEncoding: TLabel
Left = 278
Height = 15
Height = 16
Top = 130
Width = 74
Width = 88
Caption = 'File encoding:'
ParentColor = False
end
object checkForceWhiteBackground: TCheckBox
Left = 9
Height = 19
Height = 18
Top = 152
Width = 153
Width = 178
Caption = 'Force white background?'
TabOrder = 11
end
object buttonViewDebugInfo: TButton
Left = 256
Left = 344
Height = 17
Top = 153
Width = 131
@ -296,5 +296,13 @@ object frmFPVViewer: TfrmFPVViewer
OnClick = buttonAdjustClick
TabOrder = 14
end
object checkShowPage: TCheckBox
Left = 216
Height = 18
Top = 152
Width = 87
Caption = 'Show Page'
TabOrder = 15
end
end
end

View File

@ -27,6 +27,7 @@ type
buttonAdjust: TButton;
buttonViewDebugInfo: TButton;
buttonRenderingTest: TButton;
checkShowPage: TCheckBox;
checkForceWhiteBackground: TCheckBox;
comboEncoding: TComboBox;
editFileName: TFileNameEdit;
@ -97,6 +98,7 @@ const
var
Vec: TvVectorialDocument;
CanvasSize: TPoint;
lCurPage: TvVectorialPage;
begin
// First check the in input
if editFileName.FileName = '' then Exit; // silent exit in this simple case
@ -137,6 +139,13 @@ begin
if checkForceWhiteBackground.Checked then Vec.GetPageAsVectorial(0).BackgroundColor := colWhite;
if not checkForceWhiteBackground.Checked then
Vec.GetPageAsVectorial(0).DrawBackground(Drawer.Drawing.Canvas);
if checkShowPage.Checked then
Vec.GetPageAsVectorial(0).RenderPageBorder(
Drawer.Drawing.Canvas,
FPVVIEWER_SPACE_FOR_NEGATIVE_COORDS + Drawer.PosX,
Drawer.Drawing.Height - FPVVIEWER_SPACE_FOR_NEGATIVE_COORDS + Drawer.PosY,
spinScale.Value,
-1 * spinScale.Value);
Vec.GetPageAsVectorial(0).Render(
Drawer.Drawing.Canvas,
FPVVIEWER_SPACE_FOR_NEGATIVE_COORDS + Drawer.PosX,
@ -306,6 +315,7 @@ procedure TfrmFPVViewer.Button2Click(Sender: TObject);
var
Vec: TvVectorialDocument;
i: Integer;
lCurPage: TvVectorialPage;
begin
// First check the in input
//if not CheckInput() then Exit;

Binary file not shown.