[Mono-dev] System.Drawing.Graphics exceptions

Jon_James at Dell.com Jon_James at Dell.com
Tue Jul 14 17:13:40 EDT 2009


Text file must have not gone through.  Fyi, I installed paintdotnet and was able to run from command line.

Xdpyinfo output below:

name of display:    :0.0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    70101000
X.Org version: 7.1.1
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x3600020, revert to Parent
number of extensions:    30
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    Extended-Visual-Information
    GLX
    MIT-SCREEN-SAVER
    MIT-SHM
    MIT-SUNDRY-NONSTANDARD
    RANDR
    RECORD
    RENDER
    SECURITY
    SGI-GLX
    SHAPE
    SYNC
    TOG-CUP
    X-Resource
    XC-APPGROUP
    XC-MISC
    XFIXES
    XFree86-Bigfont
    XFree86-DGA
    XFree86-Misc
    XFree86-VidModeExtension
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1440x900 pixels (304x190 millimeters)
  resolution:    120x120 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x44
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store NO, save-unders NO
  largest cursor:    64x64
  current input event mask:    0xfa2033
    KeyPressMask             KeyReleaseMask           EnterWindowMask          
    LeaveWindowMask          ButtonMotionMask         StructureNotifyMask      
    SubstructureNotifyMask   SubstructureRedirectMask FocusChangeMask          
    PropertyChangeMask       ColormapChangeMask       
  number of visuals:    9
  default visual id:  0x23
  visual:
    visual id:    0x23
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x24
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x25
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x26
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x27
    class:    DirectColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x28
    class:    DirectColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x29
    class:    DirectColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x2a
    class:    DirectColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x42
    class:    TrueColor
    depth:    32 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits

-----Original Message-----
From: Sebastien Pouliot [mailto:sebastien.pouliot at gmail.com] 
Sent: Tuesday, July 14, 2009 4:07 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 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