MathGroup Archive 2010

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

Search the Archive

Re: Line into Image

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107476] Re: [mg107470] Line into Image
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 14 Feb 2010 05:57:36 -0500 (EST)
  • Reply-to: hanlonr at cox.net

$Version

7.0 for Mac OS X x86 (64-bit) (February 19, 2009)

plt = Plot[x^Range[3], {x, 0, 1}];

Export["plt.png", plt];

png = Rasterize[Import["plt.png"]];

With[{
  xmin = 16.5, xmax = 351,
  ymin = 15, ymax = 222.5},
 Manipulate[
  Show[
   png,
   Graphics[{Cyan, Thick,
     Line[{{x (xmax - xmin) + xmin, ymin},
       {x (xmax - xmin) + xmin, ymax}}],
     Line[{{xmin, y (ymax - ymin) + ymin},
       {xmax, y (ymax - ymin) + ymin}}]}]],
  {{x, 0.50}, 0., 1., 0.01,
   Appearance -> "Labeled"},
  {{y, 0.50}, 0., 1., 0.01,
   Appearance -> "Labeled"},
  ControlType -> {Slider, VerticalSlider},
  ControlPlacement -> {Top, Left}]]

The labels on the sliders are editable. They can be selected and modified. 
Then click in the frame to "enter"the value and cause the slider to move to
 the entered value.

Although on my system, the initial evaluation causes an error -- pink box over the output ("The specified setting for the option InputFieldBoxOptions, Appearance cannot be used."), moving either slider resolves this.


Bob Hanlon

---- "Francisco Javier Ch=C3=A1vez Contreras" <francisco.chavez at usach.cl> wrote:

=============
Good Evening:

I have a PNG image from a chart (curves), and i need to insert into it two
lines of cyan color. These lines have to be moved into the PNG using two
Sliders (one for the vertical line, and other for the horizontal line).

I created the Slider using the "Control" function, because provide me the
option for enter the values or "slide" a value.

I created both cyan lines and saved into a variable, but i cant superpose
these lines and move them.

Can anyone of you help me "math friends"?

Sorry my english!


Cheers,
Francisco Ch=E1vez C.
Santiago, Chile.




  • Prev by Date: Shadow error when trying to use ParallelTable
  • Next by Date: Re: Line into Image
  • Previous by thread: Re: Line into Image
  • Next by thread: Can I set Page Setup scale for a notebook programmatically?