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

Home » Public Forums » archive » Re: Centering Image
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
Re: Centering Image [message #67083] Tue, 23 June 2009 11:24
vikramivatury is currently offline  vikramivatury
Messages: 24
Registered: May 2009
Junior Member
On Jun 23, 3:55 am, Phil Elson <philipel...@googlemail.com> wrote:
> You mean something like this?
>
> image=INDGEN(100,50)
> dims=SIZE(image,/DIM)
> screen_size=[!D.X_SIZE,!D.Y_SIZE]
> pos=(screen_size-dims)/2
> TVSCL, image, pos[0], pos[1]

Yes, that is exactly what I was looking for. Thanks Phil!

-Vikram
Re: Centering Image [message #67090 is a reply to message #67083] Tue, 23 June 2009 00:55 Go to previous message
philipelson is currently offline  philipelson
Messages: 9
Registered: March 2009
Junior Member
You mean something like this?

image=INDGEN(100,50)
dims=SIZE(image,/DIM)
screen_size=[!D.X_SIZE,!D.Y_SIZE]
pos=(screen_size-dims)/2
TVSCL, image, pos[0], pos[1]
Re: Centering Image [message #67099 is a reply to message #67090] Mon, 22 June 2009 10:29 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vikram writes:

> Thanks. Is there something with the TVSCL function?

Do you mean this:

IDL> TVImage, BytScl(image), POSITION=Aspect(1.0)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Centering Image [message #67100 is a reply to message #67099] Mon, 22 June 2009 10:02 Go to previous message
vikramivatury is currently offline  vikramivatury
Messages: 24
Registered: May 2009
Junior Member
On Jun 22, 12:58 pm, David Fanning <n...@dfanning.com> wrote:
> Vikram writes:
>> Is there any way of centering an image on a window with equal [x,y]
>> dimensions?
>
> IDL> TVImage, image POSITION=Aspect(1.0)
>
> ASPECT and TVIMAGE can be found at the usual places:
>
>   http://www.dfanning.com/documents/programs.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks. Is there something with the TVSCL function?

-Vikram
Re: Centering Image [message #67101 is a reply to message #67100] Mon, 22 June 2009 09:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vikram writes:

> Is there any way of centering an image on a window with equal [x,y]
> dimensions?

IDL> TVImage, image POSITION=Aspect(1.0)

ASPECT and TVIMAGE can be found at the usual places:

http://www.dfanning.com/documents/programs.html

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL object graphics code logs me out?!
Next Topic: Re: Catalyst CatDestroyDefaults

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

Current Time: Wed Oct 08 15:21:51 PDT 2025

Total time taken to generate the page: 0.00571 seconds