BufferedGraphicsContext.Allocate 메서드

정의

그래픽 버퍼를 만듭니다.

오버로드

Allocate(Graphics, Rectangle)

지정된 Graphics의 픽셀 형식을 사용하여 지정된 크기의 그래픽 버퍼를 만듭니다.

Allocate(IntPtr, Rectangle)

지정된 Graphics의 픽셀 형식을 사용하여 지정된 크기의 그래픽 버퍼를 만듭니다.

Allocate(Graphics, Rectangle)

Source:
BufferedGraphicsContext.cs
Source:
BufferedGraphicsContext.cs
Source:
BufferedGraphicsContext.cs

지정된 Graphics의 픽셀 형식을 사용하여 지정된 크기의 그래픽 버퍼를 만듭니다.

public:
 System::Drawing::BufferedGraphics ^ Allocate(System::Drawing::Graphics ^ targetGraphics, System::Drawing::Rectangle targetRectangle);
public System.Drawing.BufferedGraphics Allocate (System.Drawing.Graphics targetGraphics, System.Drawing.Rectangle targetRectangle);
member this.Allocate : System.Drawing.Graphics * System.Drawing.Rectangle -> System.Drawing.BufferedGraphics
Public Function Allocate (targetGraphics As Graphics, targetRectangle As Rectangle) As BufferedGraphics

매개 변수

targetGraphics
Graphics

새 버퍼의 픽셀 형식을 일치시킬 대상 Graphics입니다.

targetRectangle
Rectangle

만들 버퍼의 크기를 나타내는 Rectangle입니다.

반환

지정된 크기의 버퍼를 그리는 데 사용할 수 있는 BufferedGraphics입니다.

예제

다음 코드 예제를 사용 하 여 그래픽 버퍼를 만드는 방법을 보여 줍니다는 Allocate 메서드. 이 코드는 클래스에 대해 제공되는 더 큰 예제의 BufferedGraphics 일부입니다.

// Allocates a graphics buffer using the pixel format 
// of the specified Graphics object.
grafx = appDomainBufferedGraphicsContext->Allocate( this->CreateGraphics(),
   Rectangle( 0, 0, 400, 400 ) );
// Allocates a graphics buffer using the pixel format
// of the specified Graphics object.
grafx = appDomainBufferedGraphicsContext.Allocate(this.CreateGraphics(),
     new Rectangle( 0, 0, 400, 400 ));
' Allocates a graphics buffer using the pixel format 
' of the specified Graphics object.
grafx = appDomainBufferedGraphicsContext.Allocate(Me.CreateGraphics(), New Rectangle(0, 0, 400, 400))

설명

크기가 Allocate 속성 값을 MaximumBuffer 초과하는 사각형을 사용하여 메서드를 호출하면 버퍼를 할당하고 버퍼에 대한 임시 컨텍스트를 제공하기 위해 임시 BufferedGraphicsContext 가 만들어집니다. 새 BufferedGraphicsContext 구별 되는 BufferedGraphicsContext 애플리케이션에 대 한 도메인 하며 자동으로 삭제 됩니다 때 합니다 BufferedGraphics 반환한를 Allocate 메서드 삭제 됩니다.

추가 정보

적용 대상

Allocate(IntPtr, Rectangle)

Source:
BufferedGraphicsContext.cs
Source:
BufferedGraphicsContext.cs
Source:
BufferedGraphicsContext.cs

지정된 Graphics의 픽셀 형식을 사용하여 지정된 크기의 그래픽 버퍼를 만듭니다.

public:
 System::Drawing::BufferedGraphics ^ Allocate(IntPtr targetDC, System::Drawing::Rectangle targetRectangle);
public System.Drawing.BufferedGraphics Allocate (IntPtr targetDC, System.Drawing.Rectangle targetRectangle);
member this.Allocate : nativeint * System.Drawing.Rectangle -> System.Drawing.BufferedGraphics
Public Function Allocate (targetDC As IntPtr, targetRectangle As Rectangle) As BufferedGraphics

매개 변수

targetDC
IntPtr

nativeint

새 버퍼의 픽셀 형식을 일치시킬 대상 디바이스 컨텍스트에 대한 IntPtr입니다.

targetRectangle
Rectangle

만들 버퍼의 크기를 나타내는 Rectangle입니다.

반환

지정된 크기의 버퍼를 그리는 데 사용할 수 있는 BufferedGraphics입니다.

예제

다음 코드 예제를 사용 하 여 그래픽 버퍼를 만드는 방법을 보여 줍니다는 Allocate 메서드. 이 코드는 클래스에 대해 제공되는 더 큰 예제의 BufferedGraphics 일부입니다.

// Allocates a graphics buffer using the pixel format 
// of the specified handle to a device context.
grafx = appDomainBufferedGraphicsContext->Allocate( this->Handle,
   Rectangle( 0, 0, 400, 400 ) );
// Allocates a graphics buffer using the pixel format
// of the specified handle to a device context.
grafx = appDomainBufferedGraphicsContext.Allocate(this.Handle,
     new Rectangle( 0, 0, 400, 400 ));
' Allocates a graphics buffer using the pixel format 
' of the specified handle to device context.
grafx = appDomainBufferedGraphicsContext.Allocate(Me.Handle, New Rectangle(0, 0, 400, 400))

설명

크기가 Allocate 속성 값을 MaximumBuffer 초과하는 사각형을 사용하여 메서드를 호출하면 버퍼를 할당하고 버퍼에 대한 임시 컨텍스트를 제공하기 위해 임시 BufferedGraphicsContext 가 만들어집니다. 새 BufferedGraphicsContext 구별 되는 BufferedGraphicsContext 애플리케이션에 대 한 도메인 하며 자동으로 삭제 됩니다 때 합니다 BufferedGraphics 반환한를 Allocate 메서드 삭제 됩니다.

추가 정보

적용 대상