次の方法で共有


BufferedGraphicsContext.Allocate メソッド

定義

グラフィックス バッファーを作成します。

オーバーロード

名前 説明
Allocate(Graphics, Rectangle)

指定した Graphicsのピクセル形式を使用して、指定したサイズのグラフィックス バッファーを作成します。

Allocate(IntPtr, Rectangle)

指定した Graphicsのピクセル形式を使用して、指定したサイズのグラフィックス バッファーを作成します。

Allocate(Graphics, Rectangle)

ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs

指定した 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

パラメーター

targetGraphics
Graphics

新しいバッファーのピクセル形式に一致する Graphics

targetRectangle
Rectangle

作成するバッファーのサイズを示す Rectangle

戻り値

指定したディメンションのバッファーに描画するために使用できる BufferedGraphics

次のコード例では、 Allocate メソッドを使用してグラフィックス バッファーを作成する方法を示します。 このコードは、 BufferedGraphics クラスに提供されるより大きな例の一部です。

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

注釈

サイズが MaximumBuffer プロパティの値を超える四角形を使用して Allocate メソッドを呼び出すと、バッファーを割り当て、バッファーの一時的なコンテキストを提供する一時的なBufferedGraphicsContextが作成されます。 新しいBufferedGraphicsContextはアプリケーション ドメインのBufferedGraphicsContextとは異なり、Allocate メソッドによって返されるBufferedGraphicsが破棄されると自動的に破棄されます。

こちらもご覧ください

適用対象

Allocate(IntPtr, Rectangle)

ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs
ソース:
BufferedGraphicsContext.cs

指定した 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

パラメーター

targetDC
IntPtr

nativeint

新しいバッファーのピクセル形式に一致するデバイス コンテキストへの IntPtr

targetRectangle
Rectangle

作成するバッファーのサイズを示す Rectangle

戻り値

指定したディメンションのバッファーに描画するために使用できる BufferedGraphics

次のコード例では、 Allocate メソッドを使用してグラフィックス バッファーを作成する方法を示します。 このコードは、 BufferedGraphics クラスに提供されるより大きな例の一部です。

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

注釈

サイズが MaximumBuffer プロパティの値を超える四角形を使用して Allocate メソッドを呼び出すと、バッファーを割り当て、バッファーの一時的なコンテキストを提供する一時的なBufferedGraphicsContextが作成されます。 新しいBufferedGraphicsContextはアプリケーション ドメインのBufferedGraphicsContextとは異なり、Allocate メソッドによって返されるBufferedGraphicsが破棄されると自動的に破棄されます。

こちらもご覧ください

適用対象