首页  编辑  

剪贴板中取出位图

Tags: /C#/剪贴板/   Date Created:

IDataObject vDataObject = Clipboard . GetDataObject();

if (vDataObject . GetDataPresent( DataFormats . Bitmap))

{

    Bitmap vBitmap = ( Bitmap )vDataObject . GetData( DataFormats . Bitmap);

   vBitmap . Save( @"c:\temp\temp.bmp" );

}

// or

Image vImage = Clipboard . GetImage();

if (vImage != null )

{

   if (vImage is Bitmap )

       vImage . Save( @"c:\temp\temp.bmp" );

}