PrintPreviewControl.UseAntiAlias 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
인쇄할 때 운영 체제의 앤티 앨리어스 기능을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다.
public:
property bool UseAntiAlias { bool get(); void set(bool value); };
public bool UseAntiAlias { get; set; }
member this.UseAntiAlias : bool with get, set
Public Property UseAntiAlias As Boolean
속성 값
앤티 앨리어스가 사용되면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 코드 예제에서는 Document, UseAntiAlias및 Zoom 의 속성을 보여 줍니다 PrintPreviewControl. 이 예제를 실행하려면 폼에 다음 코드를 배치하고 폼의 생성자 또는 Load 이벤트 처리 메서드에서 메서드를 호출 InitializePrintPreviewControl
합니다.
internal:
// Declare the PrintPreviewControl object and the
// PrintDocument object.
PrintPreviewControl^ PrintPreviewControl1;
private:
System::Drawing::Printing::PrintDocument^ docToPrint;
void InitializePrintPreviewControl()
{
// Construct the PrintPreviewControl.
this->PrintPreviewControl1 = gcnew PrintPreviewControl;
// Set location, name, and dock style for PrintPreviewControl1.
this->PrintPreviewControl1->Location = Point(88,80);
this->PrintPreviewControl1->Name = "PrintPreviewControl1";
this->PrintPreviewControl1->Dock = DockStyle::Fill;
// Set the Document property to the PrintDocument
// for which the PrintPage event has been handled.
this->PrintPreviewControl1->Document = docToPrint;
// Set the zoom to 25 percent.
this->PrintPreviewControl1->Zoom = 0.25;
// Set the document name. This will show be displayed when
// the document is loading into the control.
this->PrintPreviewControl1->Document->DocumentName = "c:\\someFile";
// Set the UseAntiAlias property to true so fonts are smoothed
// by the operating system.
this->PrintPreviewControl1->UseAntiAlias = true;
// Add the control to the form.
this->Controls->Add( this->PrintPreviewControl1 );
// Associate the event-handling method with the
// document's PrintPage event.
this->docToPrint->PrintPage += gcnew System::Drawing::Printing::PrintPageEventHandler( this, &Form1::docToPrint_PrintPage );
}
// The PrintPreviewControl will display the document
// by handling the documents PrintPage event
void docToPrint_PrintPage( Object^ /*sender*/, System::Drawing::Printing::PrintPageEventArgs^ e )
{
// Insert code to render the page here.
// This code will be called when the control is drawn.
// The following code will render a simple
// message on the document in the control.
String^ text = "In docToPrint_PrintPage method.";
System::Drawing::Font^ printFont = gcnew System::Drawing::Font( "Arial",35,FontStyle::Regular );
e->Graphics->DrawString( text, printFont, Brushes::Black, 10, 10 );
}
// Declare the PrintPreviewControl object and the
// PrintDocument object.
internal PrintPreviewControl PrintPreviewControl1;
private System.Drawing.Printing.PrintDocument docToPrint =
new System.Drawing.Printing.PrintDocument();
private void InitializePrintPreviewControl()
{
// Construct the PrintPreviewControl.
this.PrintPreviewControl1 = new PrintPreviewControl();
// Set location, name, and dock style for PrintPreviewControl1.
this.PrintPreviewControl1.Location = new Point(88, 80);
this.PrintPreviewControl1.Name = "PrintPreviewControl1";
this.PrintPreviewControl1.Dock = DockStyle.Fill;
// Set the Document property to the PrintDocument
// for which the PrintPage event has been handled.
this.PrintPreviewControl1.Document = docToPrint;
// Set the zoom to 25 percent.
this.PrintPreviewControl1.Zoom = 0.25;
// Set the document name. This will show be displayed when
// the document is loading into the control.
this.PrintPreviewControl1.Document.DocumentName = "c:\\someFile";
// Set the UseAntiAlias property to true so fonts are smoothed
// by the operating system.
this.PrintPreviewControl1.UseAntiAlias = true;
// Add the control to the form.
this.Controls.Add(this.PrintPreviewControl1);
// Associate the event-handling method with the
// document's PrintPage event.
this.docToPrint.PrintPage +=
new System.Drawing.Printing.PrintPageEventHandler(
docToPrint_PrintPage);
}
// The PrintPreviewControl will display the document
// by handling the documents PrintPage event
private void docToPrint_PrintPage(
object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
// Insert code to render the page here.
// This code will be called when the control is drawn.
// The following code will render a simple
// message on the document in the control.
string text = "In docToPrint_PrintPage method.";
System.Drawing.Font printFont =
new Font("Arial", 35, FontStyle.Regular);
e.Graphics.DrawString(text, printFont,
Brushes.Black, 10, 10);
}
'Declare the PrintPreviewControl object and the PrintDocument object.
Friend WithEvents PrintPreviewControl1 As PrintPreviewControl
Private WithEvents docToPrint As New Printing.PrintDocument
Private Sub InitializePrintPreviewControl()
' Construct the PrintPreviewControl.
Me.PrintPreviewControl1 = New PrintPreviewControl
' Set location, name, and dock style for PrintPreviewControl1.
Me.PrintPreviewControl1.Location = New Point(88, 80)
Me.PrintPreviewControl1.Name = "PrintPreviewControl1"
Me.PrintPreviewControl1.Dock = DockStyle.Fill
' Set the Document property to the PrintDocument
' for which the PrintPage event has been handled.
Me.PrintPreviewControl1.Document = docToPrint
' Set the zoom to 25 percent.
Me.PrintPreviewControl1.Zoom = 0.25
' Set the document name. This will show be displayed when
' the document is loading into the control.
Me.PrintPreviewControl1.Document.DocumentName = "c:\someFile"
' Set the UseAntiAlias property to true so fonts are smoothed
' by the operating system.
Me.PrintPreviewControl1.UseAntiAlias = True
' Add the control to the form.
Me.Controls.Add(Me.PrintPreviewControl1)
End Sub
' The PrintPreviewControl will display the document
' by handling the documents PrintPage event
Private Sub docToPrint_PrintPage(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles docToPrint.PrintPage
' Insert code to render the page here.
' This code will be called when the control is drawn.
' The following code will render a simple
' message on the document in the control.
Dim text As String = "In docToPrint_PrintPage method."
Dim printFont As New Font _
("Arial", 35, System.Drawing.FontStyle.Regular)
e.Graphics.DrawString(text, printFont, _
System.Drawing.Brushes.Black, 10, 10)
End Sub
설명
앤티앨리어싱은 글꼴이 렌더링될 때 들쭉날쭉한 줄을 제거합니다.
적용 대상
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET