FirstPageHeaderGap: Double;
FirstPageHeaderGap: double;
The FirstPageHeaderGap property determines indent for a header on the first page.
To set footer indent for the first page, use the ITabSheetPrinter.FirstPageFooterGap property.
Executing the example requires the form containing the components:
Button with the Button1 identifier.
TabSheetBox with the TabSheetBox1 identifier.
UiTabSheet with the UiTabSheet1 identifier.
ImageBox with the ImageBox1 identifier.
Set the UiTabSheet1 component as a data source for the TabSheetBox1 component.
The file system must include the C:/map.bmp file containing an image.
Add a link to the Drawing system assembly.
This example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
tSheet: ITabSheet;
Printer: ITabSheetPrinter;
pCount: Integer;
Graphics: IGxGraphics;
m_Image: IGxImage;
Begin
tSheet := UiTabSheet1.TabSheet;
Printer := tSheet.CreatePrinter;
// Set up indents for the first page
Printer.FirstPageHeaderGap := 30;
Printer.FirstPageFooterGap := 30;
Printer.DifferentFirstPageGap := True;
// Set up indents for even pages
Printer.EvenHeaderGap := 20;
Printer.EvenFooterGap := 20;
Printer.DifferentEvenPageGap := True;
pCount := Printer.GetPageCount;
If pCount > 0 Then
m_Image := New GxImage.CreateFromFile("C:/map.bmp");
Graphics := GxGraphicsClass.FromImage(m_Image);
Printer.PrintPage(1, Graphics);
ImageBox1.Image := m_Image;
End If;
End Sub Button1OnClick;
On clicking the Button1 button indents will be set for the first page and for even pages. Contents of the TabSheetBox1 component will be placed in the ImageBox1 component with set parameters.
Requirements of the Fore.NET Example are identical with the Fore Example requirements. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
tSheet: ITabSheet;
Printer: ITabSheetPrinter;
pCount: Integer;
Graphics: GxGraphics;
GraphClass: GxGraphicsClass;
GxClass: GxImageClass;
m_Image: GxImage;
Begin
tSheet := UiTabSheetNet1.TabSheetUi.TabSheet;
Printer := tSheet.CreatePrinter();
// Set up indents for the first page
Printer.FirstPageHeaderGap := 30;
Printer.FirstPageFooterGap := 30;
Printer.DifferentFirstPageGap := True;
// Set up indents for even pages
Printer.EvenHeaderGap := 20;
Printer.EvenFooterGap := 20;
Printer.DifferentEvenPageGap := True;
pCount := Printer.GetPageCount();
If pCount > 0 Then
GxClass := New GxImageClassClass();
m_Image := GxClass.FromFile("C:/map.bmp");
GraphClass := New GxGraphicsClassClass();
Graphics := GraphClass.FromImage(m_Image);
Printer.PrintPage(1, Graphics);
m_Image.SaveToFile("C:/map1.bmp");
PictureBox1.Image := Image.FromFile("C:/map1.bmp");
End If;
End Sub;
On clicking the Button1 button indents will be set for the first page and for even pages. The TabSheetBox1 component contents will be saved in the C:/map1.bmp file and loaded to the PictureBox1 component.
See also: