[Mono-dev] System.Drawing.Graphics exceptions
Sebastien Pouliot
sebastien.pouliot at gmail.com
Tue Jul 14 17:07:06 EDT 2009
On Tue, 2009-07-14 at 15:55 -0500, Jon_James at Dell.com wrote:
> FYI, I was able to launch paintdotnet from console.
and what's the output of xdpyinfo ?
>
> -----Original Message-----
> From: Sebastien Pouliot [mailto:sebastien.pouliot at gmail.com]
> Sent: Tuesday, July 14, 2009 2:44 PM
> To: James, Jon
> Cc: mono-devel-list at lists.ximian.com
> Subject: RE: [Mono-dev] System.Drawing.Graphics exceptions
>
> On Tue, 2009-07-14 at 14:29 -0500, Jon_James at Dell.com wrote:
> > Hi Sebastien,
> >
> > I'm able to login and open applications if that's what you're asking.
> > Can you give me a test to try out?
>
> What's the output of xdpyinfo ?
>
> > I can open gedit from console if that's what you're asking.
>
> gedit is a GTK application. Do you have any (GUI) mono-based
> applications running on that box ? if so which ones ?
>
> > FYI: this is on RHEL5.3 64 bit.
> >
> > Jon
> >
> > -----Original Message-----
> > From: Sebastien Pouliot [mailto:sebastien.pouliot at gmail.com]
> > Sent: Tuesday, July 14, 2009 2:22 PM
> > To: James, Jon
> > Cc: mono-devel-list at lists.ximian.com
> > Subject: Re: [Mono-dev] System.Drawing.Graphics exceptions
> >
> > Hello Jon,
> >
> > The exception from your previous email* shows the problem:
> >
> > [root at localhost BTOAD]# mono RMScreenShot.exe test.jpg
> > > BTOStudio RM Client ScreenShot Utility
> > < ERROR > Fatal Error: System.NotImplementedException: 0bbp
> > depth not
> > supported.
> >
> > So for some reason (is X running? remote access??) the current visual
> > returns 0bbp which is unusable to create a screenshot.
> >
> > Are you able to run GUI (e.g. SWF) apps from your terminal session ?
> >
> > Sebastien
> >
> > * please note that this is a mailing-list, even if you're using it like
> > a forum with nabble. As such it can be difficult to read your email
> > thread if you don't include the text from previous one.
> >
> > On Tue, 2009-07-14 at 11:37 -0700, Jon James wrote:
> > > -bump-
> > >
> > > Any thoughts around this problem? I've gone through the
> > > system.drawing.graphics source code. I'm thinking there is an issue with
> > > this line:
> > >
> > > 240: Bitmap bmp = new Bitmap (blockRegionSize.Width,
> > > blockRegionSize.Height); or the visual object that is created in the
> > > method.
> > >
> > > or these lines:
> > >
> > > 229: XVisualInfo visual = new XVisualInfo ();
> > >
> > > /* Get XVisualInfo for this visual */
> > > visual.visualid = GDIPlus.XVisualIDFromVisual(defvisual);
> > > vPtr = GDIPlus.XGetVisualInfo (GDIPlus.Display, 0x1 /* VisualIDMask */, ref
> > > visual, ref nitems);
> > > visual = (XVisualInfo) Marshal.PtrToStructure(vPtr, typeof (XVisualInfo));
> > >
> > > /* Sorry I do not have access to a computer with > deepth. Fell free to add
> > > more pixel formats */
> > > image = GDIPlus.XGetImage (GDIPlus.Display, window, sourceX, sourceY,
> > > blockRegionSize.Width,
> > > blockRegionSize.Height, AllPlanes, 2 /* ZPixmap*/);
> > >
> > > Bitmap bmp = new Bitmap (blockRegionSize.Width, blockRegionSize.Height);
> > > int red, blue, green;
> > > for (int y = 0; y < blockRegionSize.Height; y++) {
> > > for (int x = 0; x < blockRegionSize.Width; x++) {
> > > pixel = GDIPlus.XGetPixel (image, x, y);
> > >
> > > switch (visual.depth) {
> > > case 16: /* 16bbp pixel transformation */
> > > red = (int) ((pixel & visual.red_mask ) >> 8) & 0xff;
> > > green = (int) (((pixel & visual.green_mask ) >> 3 )) & 0xff;
> > > blue = (int) ((pixel & visual.blue_mask ) << 3 ) & 0xff;
> > > break;
> > > case 24:
> > > case 32:
> > > red = (int) ((pixel & visual.red_mask ) >> 16) & 0xff;
> > > green = (int) (((pixel & visual.green_mask ) >> 8 )) & 0xff;
> > > blue = (int) ((pixel & visual.blue_mask )) & 0xff;
> > > break;
> > > default:
> > > string text = Locale.GetText ("{0}bbp depth not supported.",
> > > visual.depth);
> > > throw new NotImplementedException (text);
> > > }
> >
>
More information about the Mono-devel-list
mailing list