[Mono-list] System.Drawing / Bitmap bug

Abe Gillespie abe.gillespie at gmail.com
Tue Jun 21 13:52:11 EDT 2005


Did anyone else have any ideas on this?  This is sorta leaving me dead
in the water right now.

Thanks.
-Abe

On 6/17/05, Dilton McGowan II <diltonm at yahoo.com> wrote:
> I have to remember to hit Reply To Everyone, we
> seriously need a REAL forum!
> 
> PS Make sure you do not start XSP while running under
> an X tunneled session or you will have many problems
> related to graphics!!!!!!!
> 
> Or if you must then do this if you have a start script
> to put it into the background in say /etc/init.d
> 
> echo sudo /etc/initi.d/my_xsp_start_script | at now
> 
> One of the guys on our team fonud this. It's still
> better to not use a tunneled X session if using
> graphics in ASP.NET on Mono when starting the XSP
> process.
> 
> --- Abe Gillespie <abe.gillespie at gmail.com> wrote:
> 
> > :(  Sadly the work around does not work in my case.
> > I'm getting the
> > same results in ASP.NET with a file on disk but it's
> > a broken image.
> > The file size seems correct but it's a 0x0 pixel
> > image.
> >
> > -Abe
> >
> > On 6/17/05, Abe Gillespie <abe.gillespie at gmail.com>
> > wrote:
> > > Thanks for the tip, I'll give it a try.  This bug
> > is sort of a show
> > > stopper for me so it's good to have a work around.
> > >
> > > -Abe
> > >
> > > On 6/17/05, Dilton McGowan II <diltonm at yahoo.com>
> > wrote:
> > > > I recall a problem saving to a response stream
> > and
> > > > figured out this workaround:
> > > >
> > > > bitmap.Save(memoryStream, ImageFormat.Png);
> > > > while(! memoryStream.CanWrite) {}
> > > > memoryStream.Close();
> > > >
> > > >
> > > > --- Abe Gillespie <abe.gillespie at gmail.com>
> > wrote:
> > > >
> > > > > I do believe I found a bug.  The following
> > code
> > > > > works as expected in a
> > > > > normal Mono exe, but produces broken results
> > in Mono
> > > > > ASP.NET:
> > > > >
> > > > > using System;
> > > > > using System.IO;
> > > > > using System.Drawing;
> > > > > using System.Drawing.Imaging;
> > > > >
> > > > > // Open an image.
> > > > > FileInfo fi = new
> > FileInfo("existing_filename");
> > > > > Stream imgStream = fi.OpenRead();
> > > > > Bitmap img = new Bitmap(imgStream);
> > > > >
> > > > > // Save it.
> > > > > // In a normal Mono exe this creates a valid
> > copy of
> > > > > the original image.
> > > > > // In Mono ASP.NET this creates a new file but
> > the
> > > > > image is broken.
> > > > > img.Save("new_filename", ImageFormat.Jpeg);
> > > > >
> > > > > I will write a bug report if someone verifies
> > this.
> > > > >
> > > > > Thanks.
> > > > > -Abe
> > > > >
> > _______________________________________________
> > > > > Mono-list maillist  -
> > Mono-list at lists.ximian.com
> > > > >
> > http://lists.ximian.com/mailman/listinfo/mono-list
> > > > >
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > > http://mail.yahoo.com
> > > >
> > >
> >
> 
> 
> 
> 
> ____________________________________________________
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
> http://football.fantasysports.yahoo.com
>


More information about the Mono-list mailing list