Re: Crash of the bitmap with Format16bppGrayScale
From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 05/15/04
- Next message: Bob Powell [MVP]: "Re: can't get images out of tiff file"
- Previous message: Sahil Malik: "Re: Transparent Label"
- In reply to: Dmitry: "Crash of the bitmap with Format16bppGrayScale"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 15 May 2004 12:40:03 +0200
The 16bpp gray format does have known bugs. It was never supposed to have
been included in the framework but sneaked in there by mistake (or so I was
told by someone at MS)
Choose another format.
-- Bob Powell [MVP] Visual C#, System.Drawing Image transition effects, automatic persistent configuration and design time mouse operations all in April's issue of Well Formed http://www.bobpowell.net/wellformed.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41 "Dmitry" <anonymous@discussions.microsoft.com> wrote in message news:BA6981AA-D59B-4E42-94E9-6773AB89575B@microsoft.com... > Hello, > > I try to use CrayScale image with Format16bppGrayScale. But I have always crash during rendering, but it works for 32bppArgb. It seems to me it is a bug in the FrameWork. I included the example of the code. How can I render GrayScale image? > > private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) > { > bool crash = false; > Bitmap image = null; > if( crash ) > { > image = new Bitmap( e.ClipRectangle.Width, e.ClipRectangle.Height, PixelFormat.Format16bppGrayScale ); > } > else > { > image = new Bitmap( e.ClipRectangle.Width, e.ClipRectangle.Height, PixelFormat.Format32bppArgb ); > } > > e.Graphics.DrawImage( image, e.ClipRectangle, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel ); > > image.Dispose(); > } > > Thanks, Dmitriy
- Next message: Bob Powell [MVP]: "Re: can't get images out of tiff file"
- Previous message: Sahil Malik: "Re: Transparent Label"
- In reply to: Dmitry: "Crash of the bitmap with Format16bppGrayScale"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|