Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Imported Image In Manipulate Resizing in 7

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102636] Re: [mg102604] Imported Image In Manipulate Resizing in 7
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Mon, 17 Aug 2009 04:05:47 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

It doesn't have anything to do with the DynamicModule[].  At least part of
the problem is caused by the enclosing Panel.  You can see the horizontal
sizing problem by simply wrapping the Graphics with a Panel[], and that
aspect can nbe made to go away by adding the option Paneled->False to
the Manipulate.  I haven't tracked down the vertical sizing issue.

The good news is that there's a very simple workaround.  Just wrap
ExpressionCell[] around the body of the Manipulate.  By embedding the
contents in an inline cell, it insulates the contents from whatever
contextual environmental issues are creating the problem to begin with.

Your example is a pretty useful one.  I'll see if I can get it added
to our test regression system so that we can detect and fix problems in
the future.

Sincerely,
 
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


On Sun, 16 Aug 2009 06:42:15 -0400 (EDT), Chris Degnen wrote:
> I am seeing some irregular treatment of imported images in a
> Dynamic Module.  On version 7.0.0 the code below shows
> different results for its two outputs, which are an inset grid and a
> Manipulate window showing the same.  They should display the
> same, and indeed they do in version 6.0.2.0.  (I haven't been able
> to test it in Version 7.0.1 so far.)
>
> The results are displayed as soon as the code is run.  The problem
> seems to be that PlotRange is affected inside a Dynamic
> Module, at least in version 7.0.0.
>
> The code below tries three alternative types of inset square.  In
> both versions 6 and 7, if the "plain graphics square" is used
> everything works fine.  The problem occurs with imported
> bitmap graphics.  Alternative versions of the square are included
> which replicate an imported bitmap of 59 x 59 pixels.
>
> Suggestions on how to fix the image in Dynamic Module
> appreciated.
>
>
> (* Plain graphics version *)
> square = Graphics[{Red, Rectangle[{0, 0}, {59, 59}]},
> PlotRange -> {{0, 59}, {0, 59}}, ImageSize -> {59, 59}];
>
> (* Representation of imported BMP (59 x 59 pixels), version 6 style *)
> square = Graphics[
> Raster[Table[
> Table[{0, 255, 255}, {59}], {59}], {{0, 0}, {59, 59}}, {0, 255},
> ColorFunction -> RGBColor], ImageSize -> {59, 59},
> PlotRange -> {{0, 59}, {0, 59}}];
>
> (* Representation of imported BMP (59 x 59 pixels), version 7 style *)
> If[StringTake[$Version, 1] === "7",
> square = Image[Table[Table[{0, 255, 255}, {59}], {59}],
> ColorSpace -> "RGB", ImageSize -> {59, 59}]];
>
> grid = Graphics[{Black, Rectangle[{0, 0}, {481, 481}],
> Inset[square, {30.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 30.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 90.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 150.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 210.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 270.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 330.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 390.5}, {Center, Center}, {59, 59}],
> Inset[square, {30.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {90.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {150.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {210.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {270.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {330.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {390.5, 450.5}, {Center, Center}, {59, 59}],
> Inset[square, {450.5, 450.5}, {Center, Center}, {59, 59}]},
> PlotRange -> {{0, 481}, {0, 481}}, ImageSize -> 481];
>
> insetgrid =
> Graphics[{Green, Rectangle[{0, 0}, {680, 481}],
> Inset[grid, {0, 0}, {0, 0}, {481, 481}
> ]}, PlotRange -> {{0, 680}, {0, 481}}, ImageSize -> 680]
>
> Manipulate[
> DynamicModule[{},
> Graphics[{Green, Rectangle[{0, 0}, {680, 481}], Inset[
> grid, {0, 0}, {0, 0}, {481, 481}
> ]}, PlotRange -> {{0, 680}, {0, 481}}, ImageSize -> 680]],
> SaveDefinitions -> False]





  • Prev by Date: Re: Logarithmic Axes for ListPlot3D
  • Next by Date: Re: Logarithmic Axes for ListPlot3D
  • Previous by thread: Imported Image In Manipulate Resizing in 7
  • Next by thread: Logarithmic Axes for ListPlot3D