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

Home » Public Forums » archive » laying a grid on top of an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: laying a grid on top of an image [message #15913 is a reply to message #15829] Fri, 18 June 1999 00:00 Go to previous messageGo to previous message
Daniel Peduzzi is currently offline  Daniel Peduzzi
Messages: 29
Registered: June 1999
Junior Member
Brian Nagy wrote in message <37684EAA.334F0A42@gte.net>...
> Does anyone know of a quick easy way to put a grid of lines over top of
> an existing image. I want to be able to specify the spacing on the grid
> (in pixels), for example 40 columns by 100 rows, and have a grid placed
> over top of an image which is already displayed in a window.
>


Could you alter the image before you display it in a window?

If I had a 2D array called "my_image", and I wanted different spacings in the
row and column directions, I'd do something like this:

row_freq=20
col_freq=40

s=size(my_image)
col_indices = indgen(s[1]/col_freq+1)
row_indices = indgen(s[2]/row_freq+1)

my_image[col_indices, *]=255
my_image[*, row_indices]=255

tvlct, [255], [0], [0], 255 ; Make last colormap entry "red"
tv, my_image

This would display a red grid, with the above spacings, over the image.


Dan Peduzzi
peduzzi@mediaone.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: dialog_pickfile problem
Next Topic: Improved plotting of DOUBLE data

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

Current Time: Fri Oct 10 16:04:35 PDT 2025

Total time taken to generate the page: 1.60244 seconds