BufferedGraphicsContext.Allocate Método

Definição

Cria um buffer gráfico.

Sobrecargas

Name Description
Allocate(Graphics, Rectangle)

Cria um buffer gráfico do tamanho especificado usando o formato de píxel do especificado Graphics.

Allocate(IntPtr, Rectangle)

Cria um buffer gráfico do tamanho especificado usando o formato de píxel do especificado Graphics.

Allocate(Graphics, Rectangle)

Cria um buffer gráfico do tamanho especificado usando o formato de píxel do especificado 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

Parâmetros

targetGraphics
Graphics

O Graphics para corresponder ao formato de píxeis do novo buffer para.

targetRectangle
Rectangle

A indica Rectangle o tamanho do buffer a criar.

Devoluções

A BufferedGraphics que pode ser usado para desenhar até um buffer com as dimensões especificadas.

Exemplos

O exemplo de código seguinte demonstra a criação de um buffer gráfico usando o Allocate método. Este código faz parte de um exemplo mais amplo fornecido para a BufferedGraphics turma.

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

Observações

Quando se chama o Allocate método com um retângulo cujo tamanho excede o valor da MaximumBuffer propriedade, cria-se um temporário BufferedGraphicsContext para alocar o buffer e fornecer um contexto temporário para o buffer. O novo BufferedGraphicsContext é distinto do BufferedGraphicsContext para o domínio da aplicação e é eliminado automaticamente quando o BufferedGraphics devolvido pelo Allocate método é eliminado.

Ver também

Aplica-se a

Allocate(IntPtr, Rectangle)

Cria um buffer gráfico do tamanho especificado usando o formato de píxel do especificado 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

Parâmetros

targetDC
IntPtr

nativeint

Um IntPtr para um contexto de dispositivo para corresponder ao formato de píxeis do novo buffer.

targetRectangle
Rectangle

A indica Rectangle o tamanho do buffer a criar.

Devoluções

A BufferedGraphics que pode ser usado para desenhar até um buffer com as dimensões especificadas.

Exemplos

O exemplo de código seguinte demonstra a criação de um buffer gráfico usando o Allocate método. Este código faz parte de um exemplo mais amplo fornecido para a BufferedGraphics turma.

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

Observações

Quando se chama o Allocate método com um retângulo cujo tamanho excede o valor da MaximumBuffer propriedade, cria-se um temporário BufferedGraphicsContext para alocar o buffer e fornecer um contexto temporário para o buffer. O novo BufferedGraphicsContext é distinto do BufferedGraphicsContext para o domínio da aplicação e é eliminado automaticamente quando o BufferedGraphics devolvido pelo Allocate método é eliminado.

Ver também

Aplica-se a