I am trying to implement some kind of zooming in a program that displays either a bitmap or a curve on a graphics window (%gr). For this purpose I use the mouse facilities and draw a rectangle in the graphics windows with handle=1 using:
IF(IsUp.AND.WasDown)THEN grey=RGB@(170,170,170) CALL get_graphics_selected_area@(x1,y1,x2,y2) CALL set_graphics_selection@(0) IF(AND(flags,MK_SHIFT).EQ.MK_SHIFT)THEN CALL draw_rectangle@(x1,y1,x2,y2,grey)
This code draws a rectangle in window 1 and (I presume) gives me the coordinates of the subregion I want to display in a second window as a zoom. For this purpose, I call afterwards a subroutine that creates a new graphics window with handle 2 and the same vres and hres dimensions of window 1:
subroutine make_zoom(xz1,yz1,xz2,yz2) use mswin use my_data implicit none integer*4 :: xz1,yz1,xz2,yz2 ans=winio@('%ca[Zoom]&') ans=winio@('%`gr[rgb_colours]&',hres,vres,5) call copy_graphics_region@(5,0,0,hres,vres,1,xz1,yz1,xz2,yz2,srccopy) ans=winio@('%ff%cn%bt[OK]') end subroutine make_zoom
I expected as a result that the small portion of window 1 would be displayed (and stretched) on the window 2. However, what I get in window 2 is a copy of part of window 1 greater than that enclosed by the rectangle draw in window 1, i.e. it seems that the xz1,xz2,yz1,yz2 are not taken into account when the operation of copying the graphic region is made. I do not know if I was clear enough.....or my text results a little intricate...Am I doing, perhaps, a silly mistake in my code?
Agustin