MathGroup Archive 2006

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

Search the Archive

Merging graphic objects, exporting graphics and much more worries...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70914] Merging graphic objects, exporting graphics and much more worries...
  • From: "shp" <spilja at gmail.com>
  • Date: Wed, 1 Nov 2006 03:56:03 -0500 (EST)

Hi!

I'm pretty new to Mathematica and I'm trying to draw and export some
graphics in it (as a part of a seminar).

What I0m trying to do is make cards (ie bitamps or gifs) for a card
game Set. So what I need to do is draw symbols, 1 to 3 per card, and
export them for later use.

Each card consists of 1 to 3 identical symbols, so what I tried to do
is use a For loop to generate ie 3 symbols like it's shown in this code
(numel is number of elements, y is a variable used for coordinates

numel = 3;
y = 0;
For[i = 1, i = numel,
       Show[Graphics[{Hue[0.55],
            Rectangle[{0, y}, {4, y + 1.5}],
            RGBColor[1, 1, 1], Rectangle[{0.2, y + 0.2}, {3.8, y +
1.3}]}],
        AspectRatio -> Automatic, ImageSize -> 100];
      	i++, y = y + 2.5];

What I need is a way that I can export this in a single bitamp,
containing all three rectangles. Basicaly, I need a way to include the
For loop in Graphics[], but I don't know how :-/

Trying to come up with anything useful, I found out that even the
simplest export results in a disaster.
For instance, exporting these graphics

rectangles = Graphics[{Hue[0.55], Rectangle[{0, 0}, {4, 1.5}],
         Rectangle[{0, 2.5}, {4, 4}],
        Rectangle[{0, 5}, {4, 6.5}],
        RGBColor[1, 1, 1], Rectangle[{0.2, 0.2}, {3.8, 1.3}],
        Rectangle[{0.2, 2.7}, {3.8, 3.8}],
        Rectangle[{0.2, 5.2}, {3.8, 6.3}]}];

with

Export["rectangles.bmp", rectangles, ImageSize->{150,170}];

looks nothing like the image I get using the command

Show[rectangles, AspectRatio->Automatic, ImageSize->(150,170}];

No matter what the coordinates of my rectangles are, I get the same
image, and it's pretty ugly :-/

Help please! Thank you.


  • Prev by Date: Re: Matching with a "Flat" function
  • Next by Date: ExactRootIsolation
  • Previous by thread: Re: new procedure for converting a new recursive polynomial set into matrices
  • Next by thread: Re: Merging graphic objects, exporting graphics and much more worries...