robert linder
11/17/2004 10:50:00 PM
microsoft.public.dotnet.framework.drawing
I am trying to save an image from clipboard.
IDataObject viewer shows 'CF_BITMAP' format .
Here is the code I am using to saving the clipboard to a 24bppRgb .bmp file.
------------
Bitmap bt =
(Bitmap)System.Windows.Forms.Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
Rectangle lockedRect = new Rectangle( 0,0,bt.Width,bt.Height);
BitmapData bmpData = bt.LockBits( lockedRect, ImageLockMode.ReadWrite ,
PixelFormat.Format24bppRgb);
bmpData.PixelFormat = PixelFormat.Format24bppRgb;
bt.UnlockBits(bmpData);
bt.Save( "tmp.bmp", ImageFormat.Bmp );
------------
Using a file manager , property viewer on the image file, it shows as 32
bit depth color.
------------
I need to have the bmp as 24 bits since the file is begin used by a
program that is not under my control.