GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 > PrintSettings クラス : ZoomFactor プロパティ |
例外 | 解説 |
---|---|
System.ArgumentOutOfRangeException | 指定された値が0.1fより小さいか、4fを超えています。 |
印刷時のズームでは縦横比が維持されます。
ズーム倍率の範囲は0.1〜4です。
Templateの幅が広くて0.1のズーム倍率でも1ページに完全に収まらない場合、既定では、あふれた部分が次の新しいページに印刷されます。あふれた部分を次の新しいページに印刷するかクリップするかは、HorizontalPageBreakプロパティを使用して制御します。
void setCompactAndZoomFactorButton_Click(object sender, EventArgs e) { Template template1 = CreateTemplate(2, 21); AddPrintInfoCellColumnFooterSection(template1, 21); this.gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 20; //Some UI elements will not be printed, like UpDown button. gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Compact; gcMultiRow1.PrintSettings.PagingMode = PagingMode.Flow; gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter; gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows; if (flag) { //The Template will be printed to page with the zoom ratio 3. gcMultiRow1.PrintSettings.ZoomFactor = 3f; flag = false; } else { gcMultiRow1.PrintSettings.ZoomFactor = 1f; flag = true; } gcMultiRow1.PrintSettings.AutoFitWidth = false; try { gcMultiRow1.PrintPreview(); //If you have a printer, you can execute the following code directly instead code above. //gcMultiRow1.Print(true); } catch (Exception ex) { // Can't find printer driver. MessageBox.Show(ex.Message); } label.Text = "The Compact style will not print some UI elements, like UpDown button; Click the button again to view how the ZoomFactor property takes effect."; }
Private Sub setCompactAndZoomFactorButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setCompactAndZoomFactorButton.Click Dim template1 As Template = CreateTemplate(2, 21) AddPrintInfoCellColumnFooterSection(template1, 21) Me.gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 20 'Some UI elements will not be printed, like UpDown button. gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Compact gcMultiRow1.PrintSettings.PagingMode = PagingMode.Flow gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows If flag Then 'The Template will be printed to page with the zoom ratio 3. gcMultiRow1.PrintSettings.ZoomFactor = 3.0F flag = False Else gcMultiRow1.PrintSettings.ZoomFactor = 1.0F flag = True End If gcMultiRow1.PrintSettings.AutoFitWidth = False Try 'If you have a printer, you can execute the following code directly instead code above. 'gcMultiRow1.Print(true); gcMultiRow1.PrintPreview() Catch ex As Exception ' Can't find printer driver. MessageBox.Show(ex.Message) End Try label.Text = "The Compact style will not print some UI elements, like UpDown button; Click the button again to view how the ZoomFactor property takes effect." End Sub