MathGroup Archive 2010

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

Search the Archive

Re: Line into Image

  • To: mathgroup at
  • Subject: [mg107480] Re: [mg107470] Line into Image
  • From: Patrick Scheibe <pscheibe at>
  • Date: Sun, 14 Feb 2010 05:58:20 -0500 (EST)
  • References: <>


you could do it with ImageCompose. Just overlay your Image with the
lines you want to have:

SetAttributes[lines, HoldRest];
lines[img_Image, output_] := DynamicModule[
   {nx, ny, h, v},
   {nx, ny} = ImageDimensions[img];
      output = 
        Graphics[{Cyan, Thick, Line[{{1, h}, {nx, h}}], 
          Line[{{v, 1}, {v, ny}}]}, PlotRange -> {{1, nx}, {1, ny}}]]],
     Slider[Dynamic[h], {1, ny}],
     Slider[Dynamic[v], {1, nx}]

lines[Import["";], outimg]

your final image is stored in the variable "outimg" here.


On Sat, 2010-02-13 at 05:24 -0500, Francisco Javier Chávez Contreras
> 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.

  • References:
    • Line into Image
      • From: Francisco Javier Chávez Contreras <>
  • Prev by Date: Re: Park's and Bergstrom's packages
  • Next by Date: Shadow error when trying to use ParallelTable
  • Previous by thread: Line into Image
  • Next by thread: Re: Line into Image