Bitmap.Clone メソッド (RectangleF, PixelFormat)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Bitmap Dim rect As RectangleF Dim format As PixelFormat Dim returnValue As Bitmap returnValue = instance.Clone(rect, format)
戻り値
このメソッドが作成する Bitmap。


次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgs の e が必要です。このコードは次のアクションを実行します。
Public Sub Clone_Example2(ByVal e As PaintEventArgs) ' Create a Bitmap object from a file. Dim myBitmap As New Bitmap("Grapes.jpg") ' Clone a portion of the Bitmap object. Dim cloneRect As New RectangleF(0, 0, 100, 100) Dim format As PixelFormat = myBitmap.PixelFormat Dim cloneBitmap As Bitmap = myBitmap.Clone(cloneRect, format) ' Draw the cloned portion of the Bitmap object. e.Graphics.DrawImage(cloneBitmap, 0, 0) End Sub
public void Clone_Example2(PaintEventArgs e) { // Create a Bitmap object from a file. Bitmap myBitmap = new Bitmap("Grapes.jpg"); // Clone a portion of the Bitmap object. RectangleF cloneRect = new RectangleF(0, 0, 100, 100); System.Drawing.Imaging.PixelFormat format = myBitmap.PixelFormat; Bitmap cloneBitmap = myBitmap.Clone(cloneRect, format); // Draw the cloned portion of the Bitmap object. e.Graphics.DrawImage(cloneBitmap, 0, 0); }
public: void Clone_Example2( PaintEventArgs^ e ) { // Create a Bitmap object from a file. Bitmap^ myBitmap = gcnew Bitmap( "Grapes.jpg" ); // Clone a portion of the Bitmap object. RectangleF cloneRect = RectangleF(0,0,100,100); System::Drawing::Imaging::PixelFormat format = myBitmap->PixelFormat; Bitmap^ cloneBitmap = myBitmap->Clone( cloneRect, format ); // Draw the cloned portion of the Bitmap object. e->Graphics->DrawImage( cloneBitmap, 0, 0 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap.Clone メソッド (Rectangle, PixelFormat)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Bitmap Dim rect As Rectangle Dim format As PixelFormat Dim returnValue As Bitmap returnValue = instance.Clone(rect, format)
戻り値
このメソッドが作成する新しい Bitmap オブジェクト。


次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgs の e が必要です。このコードは次のアクションを実行します。
Public Sub Clone_Example1(ByVal e As PaintEventArgs) ' Create a Bitmap object from a file. Dim myBitmap As New Bitmap("Grapes.jpg") ' Clone a portion of the Bitmap object. Dim cloneRect As New Rectangle(0, 0, 100, 100) Dim format As PixelFormat = myBitmap.PixelFormat Dim cloneBitmap As Bitmap = myBitmap.Clone(cloneRect, format) ' Draw the cloned portion of the Bitmap object. e.Graphics.DrawImage(cloneBitmap, 0, 0) End Sub
public void Clone_Example1(PaintEventArgs e) { // Create a Bitmap object from a file. Bitmap myBitmap = new Bitmap("Grapes.jpg"); // Clone a portion of the Bitmap object. Rectangle cloneRect = new Rectangle(0, 0, 100, 100); System.Drawing.Imaging.PixelFormat format = myBitmap.PixelFormat; Bitmap cloneBitmap = myBitmap.Clone(cloneRect, format); // Draw the cloned portion of the Bitmap object. e.Graphics.DrawImage(cloneBitmap, 0, 0); }
public: void Clone_Example1( PaintEventArgs^ e ) { // Create a Bitmap object from a file. Bitmap^ myBitmap = gcnew Bitmap( "Grapes.jpg" ); // Clone a portion of the Bitmap object. Rectangle cloneRect = Rectangle(0,0,100,100); System::Drawing::Imaging::PixelFormat format = myBitmap->PixelFormat; Bitmap^ cloneBitmap = myBitmap->Clone( cloneRect, format ); // Draw the cloned portion of the Bitmap object. e->Graphics->DrawImage( cloneBitmap, 0, 0 ); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap.Clone メソッド

名前 | 説明 |
---|---|
Bitmap.Clone () | 対象の Image の同一コピーを作成します。 |
Bitmap.Clone (Rectangle, PixelFormat) | Rectangle 構造体と、指定された PixelFormat 列挙体で定義された、この Bitmap のセクションのコピーを作成します。 |
Bitmap.Clone (RectangleF, PixelFormat) | 指定された PixelFormat 列挙体で定義されたこの Bitmap のセクションのコピーを作成します。 |

- Bitmap.Cloneのページへのリンク