MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Generating bitmap graphics, not Postscript

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28989] Re: Generating bitmap graphics, not Postscript
  • From: paulh at wolfram.com (P.J. Hinton)
  • Date: Thu, 24 May 2001 04:07:06 -0400 (EDT)
  • Organization: Wolfram Research, Inc.
  • References: <9efkav$1dl@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 23 May 2001 02:11:43 -0400, Simon Chandler
<simon_chandler at agilent.com> wrote:

> Hello MathGroupers,
> 
> How can I automatically generate bitmap graphics rather than Postscript graphics?
> 
> I have written a Mathematica notebook that does image processing on many jpeg files that are imported from disk. I'd like to show the resulting images in my notebook, but if I simply use ListDensityPlot the Notebook becomes unreasonably large (many tens of MB), and can cause problems. I'd be quite happy to show the images as bitmaps, and expected to find an option that would produce bitmap rather than Postscript output.  

You may want to consider redefining the Kernel's low-level display
function to achieve your objective:

$DisplayFunction := 
  (Module[
        {mgfstr, bbox, base, imgsz},
        {mgfstr, bbox, base} =
          (
            LinkWrite[
              $ParentLink,
              ExportPacket[
                Cell[
                  GraphicsData[
                    "PostScript", 
                    DisplayString[#]
                    ],
                  "Graphics"
                  ],
                "MGF"
                ]
              ];
            LinkRead[$ParentLink]
            );
        imgsz = 
          Map[
            (Subtract @@ Reverse[#]) &,
            Transpose[ bbox]
            ];
        CellPrint[
          Cell[
            GraphicsData["Bitmap", mgfstr], 
            "Graphics",
            ImageSize -> imgsz
            ]
          ]
        ] &)

>   Q3: Can anyone tell me where I can find a list of all valid tokens?

You can find much of the tokens by examining the contents of the files
named MenuSetup.tr that reside in this directory:

<path to Mathematica installation>/SystemFiles/FrontEnd/TextResources

and its subdirectories.

You can also find a list of tokens with explanations in the book
_Beginner's Guide to Mathematica Version 4_ by Glynn and Gray.

-- 
P.J. Hinton
User Interface Programmer                         paulh at wolfram.com
Wolfram Research, Inc.


  • Prev by Date: Re: ColorFunction for ListPlot3D, ListContourPlot or ListDensityPlot ?
  • Next by Date: Re: Help fitting Exponential curves
  • Previous by thread: Re: Generating bitmap graphics, not Postscript
  • Next by thread: ColorFunction for ListPlot3D, ListContourPlot or ListDensityPlot ?