Freigeben über


BufferedGraphicsContext.Allocate Methode

Definition

Erstellt einen Grafikpuffer.

Überlädt

Name Beschreibung
Allocate(Graphics, Rectangle)

Erstellt einen Grafikpuffer der angegebenen Größe mithilfe des Pixelformats des angegebenen Graphics.

Allocate(IntPtr, Rectangle)

Erstellt einen Grafikpuffer der angegebenen Größe mithilfe des Pixelformats des angegebenen Graphics.

Allocate(Graphics, Rectangle)

Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs

Erstellt einen Grafikpuffer der angegebenen Größe mithilfe des Pixelformats des angegebenen 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

Parameter

targetGraphics
Graphics

Entspricht Graphics dem Pixelformat für den neuen Puffer.

targetRectangle
Rectangle

Ein Rectangle Wert, der die Größe des zu erstellenden Puffers angibt.

Gibt zurück

Ein BufferedGraphics Wert, der zum Zeichnen in einen Puffer der angegebenen Dimensionen verwendet werden kann.

Beispiele

Im folgenden Codebeispiel wird das Erstellen eines Grafikpuffers mithilfe der Allocate Methode veranschaulicht. Dieser Code ist Teil eines größeren Beispiels, das für die BufferedGraphics Klasse bereitgestellt wird.

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

Hinweise

Wenn Sie die Allocate Methode mit einem Rechteck aufrufen, dessen Größe den Wert der MaximumBuffer Eigenschaft überschreitet, wird ein temporärer BufferedGraphicsContext Wert erstellt, um den Puffer zuzuweisen und einen temporären Kontext für den Puffer bereitzustellen. Das Neue BufferedGraphicsContext unterscheidet sich von der BufferedGraphicsContext Anwendungsdomäne und wird automatisch gelöscht, wenn die BufferedGraphics von der Allocate Methode zurückgegebene Methode verworfen wird.

Weitere Informationen

Gilt für:

Allocate(IntPtr, Rectangle)

Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs
Quelle:
BufferedGraphicsContext.cs

Erstellt einen Grafikpuffer der angegebenen Größe mithilfe des Pixelformats des angegebenen 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

Parameter

targetDC
IntPtr

nativeint

Ein IntPtr zu einem Gerätekontext, der dem Pixelformat des neuen Puffers entspricht.

targetRectangle
Rectangle

Ein Rectangle Wert, der die Größe des zu erstellenden Puffers angibt.

Gibt zurück

Ein BufferedGraphics Wert, der zum Zeichnen in einen Puffer der angegebenen Dimensionen verwendet werden kann.

Beispiele

Im folgenden Codebeispiel wird das Erstellen eines Grafikpuffers mithilfe der Allocate Methode veranschaulicht. Dieser Code ist Teil eines größeren Beispiels, das für die BufferedGraphics Klasse bereitgestellt wird.

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

Hinweise

Wenn Sie die Allocate Methode mit einem Rechteck aufrufen, dessen Größe den Wert der MaximumBuffer Eigenschaft überschreitet, wird ein temporärer BufferedGraphicsContext Wert erstellt, um den Puffer zuzuweisen und einen temporären Kontext für den Puffer bereitzustellen. Das Neue BufferedGraphicsContext unterscheidet sich von der BufferedGraphicsContext Anwendungsdomäne und wird automatisch gelöscht, wenn die BufferedGraphics von der Allocate Methode zurückgegebene Methode verworfen wird.

Weitere Informationen

Gilt für: