Condividi tramite


BufferedGraphicsContext.Allocate Metodo

Definizione

Crea un buffer grafico.

Overload

Nome Descrizione
Allocate(Graphics, Rectangle)

Crea un buffer grafico delle dimensioni specificate utilizzando il formato pixel dell'oggetto specificato Graphics.

Allocate(IntPtr, Rectangle)

Crea un buffer grafico delle dimensioni specificate utilizzando il formato pixel dell'oggetto specificato Graphics.

Allocate(Graphics, Rectangle)

Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs

Crea un buffer grafico delle dimensioni specificate utilizzando il formato pixel dell'oggetto specificato 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

Parametri

targetGraphics
Graphics

Oggetto Graphics in cui trovare la corrispondenza con il formato pixel del nuovo buffer.

targetRectangle
Rectangle

Oggetto Rectangle che indica le dimensioni del buffer da creare.

Restituisce

Oggetto BufferedGraphics che può essere utilizzato per disegnare in un buffer delle dimensioni specificate.

Esempio

L'esempio di codice seguente illustra la creazione di un buffer grafico usando il Allocate metodo . Questo codice fa parte di un esempio più ampio fornito per la BufferedGraphics classe .

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

Commenti

Quando si chiama il Allocate metodo con un rettangolo la cui dimensione supera il valore della MaximumBuffer proprietà, viene creato un BufferedGraphicsContext oggetto temporaneo per allocare il buffer e fornire un contesto temporaneo per il buffer. Il nuovo BufferedGraphicsContext oggetto è diverso da per il BufferedGraphicsContext dominio applicazione e viene eliminato automaticamente quando viene eliminato il BufferedGraphicsAllocate valore restituito dal metodo .

Vedi anche

Si applica a

Allocate(IntPtr, Rectangle)

Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs
Origine:
BufferedGraphicsContext.cs

Crea un buffer grafico delle dimensioni specificate utilizzando il formato pixel dell'oggetto specificato 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

Parametri

targetDC
IntPtr

nativeint

Oggetto IntPtr a un contesto di dispositivo in base al formato pixel del nuovo buffer.

targetRectangle
Rectangle

Oggetto Rectangle che indica le dimensioni del buffer da creare.

Restituisce

Oggetto BufferedGraphics che può essere utilizzato per disegnare in un buffer delle dimensioni specificate.

Esempio

L'esempio di codice seguente illustra la creazione di un buffer grafico usando il Allocate metodo . Questo codice fa parte di un esempio più ampio fornito per la BufferedGraphics classe .

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

Commenti

Quando si chiama il Allocate metodo con un rettangolo la cui dimensione supera il valore della MaximumBuffer proprietà, viene creato un BufferedGraphicsContext oggetto temporaneo per allocare il buffer e fornire un contesto temporaneo per il buffer. Il nuovo BufferedGraphicsContext oggetto è diverso da per il BufferedGraphicsContext dominio applicazione e viene eliminato automaticamente quando viene eliminato il BufferedGraphicsAllocate valore restituito dal metodo .

Vedi anche

Si applica a