bitmap.SaveFile - resolutions

I have a drawing, including things like arcs and circles and text; it’s shown using a ClientDC and drawn mainly using GraphicsContext and GraphicsPath, and text is drawn using the dc.DrawText method. It looks fine on the screen.

I want to print it, or save it as a PNG or JPG. I do the following (split into two methods, merged here and commented for simplicity):

    bitmap = wx.EmptyBitmap(width, height )
    memoryDC = wx.MemoryDC(bitmap) 

Set a solid white background for JPEG, leave it transparent for PNG

memoryDC.SetPen(wx.NullPen )

memoryDC.SetBrush(wx.WHITE_BRUSH)

memoryDC.DrawRectangle(0, 0, width, height )

    mapPage.doDrawing(memoryDC)                                    #the drawing is created using whatever DC is passed to it
    bitmap.SaveFile(fileName, wx.BITMAP_TYPE_PNG)

bitmap.SaveFile(fileName, wx.BITMAP_TYPE_JPEG) #either save as JPG or PNG, depending on user selection

This is prepared on an Intel Mac, running MacOS10.4.9. On the three Intel Macs I’ve tried, both the JPEG and the PNG come out looking fine, as does printing and saving the print as a PDF using the Mac’s Print Dialog built-in Save As PDF option.

However, on PPC macs (also running 10.4.9) the JPEG comes out looking fine, but the PNG looks terrible; the text, in particular, comes out as mere blocks of smeary black. The same is true on the PDF from the Save As PDF option.

Is this a known issue? -an OS or hardware issue? Is there a workaround, or am I doing something wrong I can fix?

Thanks,

Ian

···


Ian York (iayork@iayork.com
) <http://www.iayork.com/>
“-but as he was a York, I am rather inclined to suppose him a
very respectable Man.” -Jane Austen, The History of England

Ian York wrote:

This is prepared on an Intel Mac, running MacOS10.4.9. On the three Intel Macs I've tried, both the JPEG and the PNG come out looking fine, as does printing and saving the print as a PDF using the Mac's Print Dialog built-in Save As PDF option.

However, on PPC macs (also running 10.4.9) the JPEG comes out looking fine, but the PNG looks terrible; the text, in particular, comes out as mere blocks of smeary black. The same is true on the PDF from the Save As PDF option.

Is this a known issue? -an OS or hardware issue? Is there a workaround, or am I doing something wrong I can fix?

This is the first I've heard of it, please enther a bug report about it with a category of "wxMac specific". It sounds to me like it could be an endianness issue (order of bytes in integer values.)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!