comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » FG Save method -- Gifs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
FG Save method -- Gifs [message #90496] Thu, 05 March 2015 07:49 Go to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
I would like a way to choose the frame refresh rate for gifs. Let's take example from the translate method, but skip a few points between saves. I want the resulting gif to last the same amount of time as the original version, and to loop.


; Create the data.
x = FINDGEN(100)
y = 20 * Sin(x*2*!PI/25.0) * Exp(-0.01*x)

; Draw the sky and sea.
p = PLOT(x, y, XRANGE=[0,99], YRANGE=[-40,100], $
FILL_LEVEL=-40, $
AXIS_STYLE=0, MARGIN=0, DIMENSIONS=[500,400], $
BACKGROUND_COLOR="light sky blue", $
/FILL_BACKGROUND, FILL_COLOR="sea green", TRANSPARENCY=100)

; Draw the sun
e = ELLIPSE(0.9, 1, FILL_COLOR="yellow", COLOR="yellow")

; Determine the points for the boat to travel.
xx = 0.5*[-22,-19,-12,-7,8,13,18,23,0.5,0.5, $
13,8,0.5,0.5,8,3,-2,-7,0,0,-7,-12,0,0]

yy = 2*[3,-0.7,-1,-1.5,-1.5,-0.7,0.5,3,3,5, $
5,13,13,15,15,20,20,15,15,13,13,5,5,3]

; Draw the boat. Give a Z value to put the boat on top.
p1 = POLYGON(xx,yy,1,/DATA,FILL_COLOR="burlywood", CLIP=0)


; Translate p1 using data coordinates,
; translate e using device coordinates.
step = 10
FOR i=step,99,step DO BEGIN & $
p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND & $
p1.TRANSLATE, step, y[i]-y[i-step], /DATA & $
e.TRANSLATE, 1,-0.5 & $
ENDFOR

p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND, /CLOSE
Re: FG Save method -- Gifs [message #90497 is a reply to message #90496] Thu, 05 March 2015 07:51 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
p.s. the original version is here

http://exelisvis.com/docs/Translate_Method.html
Re: FG Save method -- Gifs [message #90499 is a reply to message #90497] Thu, 05 March 2015 08:37 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, March 5, 2015 at 8:51:54 AM UTC-7, Matthew Argall wrote:
> p.s. the original version is here
>
> http://exelisvis.com/docs/Translate_Method.html

Hi Matthew,

Your best bet is to write the GIF yourself using WRITE_GIF. That way you have access to the keywords like DELAY_TIME and REPEAT_COUNT.

You could do something like:

img = p.CopyWindow()
img= color_quan(img,1,red,green,blue)
write_gif, file, img, red, green, blue, ...

Cheers,
Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using 1D FFT to decompose the provided hurricane data in terms of wavenumbers.
Next Topic: Objects in ENVI ROI files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:19:10 PDT 2025

Total time taken to generate the page: 0.00423 seconds