BufferedGraphicsContext.Allocate Metoda

Definicja

Tworzy bufor graficzny.

Przeciążenia

Allocate(Graphics, Rectangle)

Tworzy bufor graficzny o określonym rozmiarze przy użyciu formatu pikseli określonego Graphicsobiektu .

Allocate(IntPtr, Rectangle)

Tworzy bufor graficzny o określonym rozmiarze przy użyciu formatu pikseli określonego Graphicsobiektu .

Allocate(Graphics, Rectangle)

Źródło:
BufferedGraphicsContext.cs
Źródło:
BufferedGraphicsContext.cs
Źródło:
BufferedGraphicsContext.cs

Tworzy bufor graficzny o określonym rozmiarze przy użyciu formatu pikseli określonego Graphicsobiektu .

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

Parametry

targetGraphics
Graphics

Dopasuj Graphics format pikseli dla nowego buforu.

targetRectangle
Rectangle

Element Rectangle wskazujący rozmiar buforu do utworzenia.

Zwraca

Element BufferedGraphics , który może służyć do rysowania do bufora określonych wymiarów.

Przykłady

Poniższy przykład kodu przedstawia tworzenie buforu graficznego Allocate przy użyciu metody . Ten kod jest częścią większego przykładu udostępnionego BufferedGraphics dla klasy .

// 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))

Uwagi

W przypadku wywołania Allocate metody z prostokątem, którego rozmiar przekracza wartość MaximumBuffer właściwości, tworzony jest tymczasowy BufferedGraphicsContext element w celu przydzielenia buforu i zapewnienia tymczasowego kontekstu buforu. Nowy BufferedGraphicsContext element różni się od BufferedGraphicsContext obiektu dla domeny aplikacji i jest usuwany automatycznie po BufferedGraphics usunięciu metody zwróconej Allocate przez metodę.

Zobacz też

Dotyczy

Allocate(IntPtr, Rectangle)

Źródło:
BufferedGraphicsContext.cs
Źródło:
BufferedGraphicsContext.cs
Źródło:
BufferedGraphicsContext.cs

Tworzy bufor graficzny o określonym rozmiarze przy użyciu formatu pikseli określonego Graphicsobiektu .

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

Parametry

targetDC
IntPtr

nativeint

Do IntPtr kontekstu urządzenia, aby dopasować format pikseli nowego buforu do.

targetRectangle
Rectangle

Element Rectangle wskazujący rozmiar buforu do utworzenia.

Zwraca

Element BufferedGraphics , który może służyć do rysowania do bufora określonych wymiarów.

Przykłady

Poniższy przykład kodu przedstawia tworzenie buforu graficznego Allocate przy użyciu metody . Ten kod jest częścią większego przykładu udostępnionego BufferedGraphics dla klasy .

// 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))

Uwagi

W przypadku wywołania Allocate metody z prostokątem, którego rozmiar przekracza wartość MaximumBuffer właściwości, tworzony jest tymczasowy BufferedGraphicsContext element w celu przydzielenia buforu i zapewnienia tymczasowego kontekstu buforu. Nowy BufferedGraphicsContext element różni się od BufferedGraphicsContext obiektu dla domeny aplikacji i jest usuwany automatycznie po BufferedGraphics usunięciu metody zwróconej Allocate przez metodę.

Zobacz też

Dotyczy