Re: Crash of the bitmap with Format16bppGrayScale

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 05/15/04


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


Relevant Pages

  • Error with the Framework or misunderstanding ?
    ... computer everything goes very well (no bugs, ... put the same software on another computer with the Framework 1.1 ... installed I don't know why but everything crash. ... I'm not suppose to have compare to the same program on my computer. ...
    (microsoft.public.dotnet.framework)
  • Re: Lost XP product key - before install.
    ... > XP SP2 is far more reliable than Linux. ... Beta means working candidate with a few bugs. ... >> principle of text config files, and with a good format and sensible ... > Trouble is that OSS writers can't/won't agree on a common format so you ...
    (uk.comp.homebuilt)
  • Re: Is this happening to anyone else?
    ... design view, and sometimes when I make changes to a form, Access crashes. ... In certain cases, the crash occurs if you make a change, but don't tab to ... you should see the Text Format property in the lower ... reinstalled Windows and loaded a purchased copy. ...
    (microsoft.public.access.forms)
  • Re: testy.rb - ruby testing thats mad at the world
    ... basically that means some yaml format. ... switched bacon for my personal projects, ... someone also brought up the app framework. ... doing here is comparing your app code to your test framework. ...
    (comp.lang.ruby)
  • Re: Query: Kdump: Core Image ELF Format
    ... >> kernel core image in ELF format. ... >> Core image ELF headers are prepared before crash and stored at a safe ...
    (Linux-Kernel)