BufferedGraphicsContext.Allocate Método

Definición

Crea un búfer de gráficos.

Sobrecargas

Allocate(Graphics, Rectangle)

Crea un búfer de gráficos del tamaño especificado con el formato de píxel del Graphics especificado.

Allocate(IntPtr, Rectangle)

Crea un búfer de gráficos del tamaño especificado con el formato de píxel del Graphics especificado.

Allocate(Graphics, Rectangle)

Crea un búfer de gráficos del tamaño especificado con el formato de píxel del Graphics especificado.

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

Parámetros

targetGraphics
Graphics

Graphics cuyo formato de píxel se va a utilizar para el nuevo búfer.

targetRectangle
Rectangle

Rectangle que indica el tamaño del búfer que se va a crear.

Devoluciones

BufferedGraphics

BufferedGraphics que se puede utilizar para dibujar en un búfer con las dimensiones especificadas.

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear un búfer de gráficos mediante el Allocate método . Este código forma parte de un ejemplo más grande proporcionado para la BufferedGraphics clase .

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

Comentarios

Cuando se llama al Allocate método con un rectángulo cuyo tamaño supera el valor de la MaximumBuffer propiedad , se crea un elemento temporal BufferedGraphicsContext para asignar el búfer y proporcionar un contexto temporal para el búfer. El nuevo BufferedGraphicsContext elemento es distinto del para BufferedGraphicsContext el dominio de aplicación y se elimina automáticamente cuando se elimina el BufferedGraphics devuelto por el Allocate método.

Consulte también

Se aplica a

Allocate(IntPtr, Rectangle)

Crea un búfer de gráficos del tamaño especificado con el formato de píxel del Graphics especificado.

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

Parámetros

targetDC
IntPtr

nativeint

IntPtr a un contexto de dispositivo cuyo formato de píxel se va a utilizar para el nuevo búfer.

targetRectangle
Rectangle

Rectangle que indica el tamaño del búfer que se va a crear.

Devoluciones

BufferedGraphics

BufferedGraphics que se puede utilizar para dibujar en un búfer con las dimensiones especificadas.

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear un búfer de gráficos mediante el Allocate método . Este código forma parte de un ejemplo más grande proporcionado para la BufferedGraphics clase .

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

Comentarios

Cuando se llama al Allocate método con un rectángulo cuyo tamaño supera el valor de la MaximumBuffer propiedad , se crea un elemento temporal BufferedGraphicsContext para asignar el búfer y proporcionar un contexto temporal para el búfer. El nuevo BufferedGraphicsContext elemento es distinto del para BufferedGraphicsContext el dominio de aplicación y se elimina automáticamente cuando se elimina el BufferedGraphics devuelto por el Allocate método.

Consulte también

Se aplica a