pro MDACZoom,pinfo
	widget_control,/hourglass

	; Reload original images

	; Ready to zoom.  Compute zoom factor.

	side = (*pinfo).sel.hside > (*pinfo).sel.vside
	zmf = 492./side

	; Get info on zoom selection if zoomed.  This section is about
	; coordinates, and is independent of the image
	side = (*pinfo).sel.hside > (*pinfo).sel.vside
	x1 = (*pinfo).sel.x1
	x2 = (*pinfo).sel.x2
	x0 = x1 < x2
	y1 = (*pinfo).sel.y1
	y2 = (*pinfo).sel.y2
	y0 = y1 < y2
	hside = float((*pinfo).sel.hside)
	vside = float((*pinfo).sel.vside)
	aratio = hside/vside

	; Get new (zoomed) dimensions of selected area
	if hside gt vside then begin
		xz = hside*zmf
		yz = xz/aratio
	endif else begin
		yz = vside*zmf
		xz = yz*aratio
	endelse

	; Load the zoomed images into (*pinfo).img (skipping)
	for zi = 0,(*pinfo).nimages-1 do begin
		; Set the window to the pixmap
		wset,(*pinfo).winIndex[zi]
		; reform gets rid of third dimension (zi)
		selimg = reform((*pinfo).img[zi,*,*])

		; Get min and max pixel values, for proper scaling.
		; Set the lower left pixel to min, and the upper right to max.
		mx = max(selimg)
		mn = 0.0
		selimg = selimg[x0:x0+hside-1,y0:y0+vside-1]

		; Zoom the selected portion to 492x492
		zimage = congrid(selimg,xz,yz,/interp)
		zimage[0,0] = mn
		zimage[xz-1,yz-1] = mx
		; Black out the background and show the zoomed image
		; This overwrites the original images.
		;***device, copy = [0,0,512,492,64,20,(*pinfo).blakWin]
		;***tv,zimage,64,20
		;***(*pinfo).img[zi,*,*] = tvrd()

		zimagedim = size(zimage,/dim)
		(*pinfo).img[zi,64:575,20:511] = (*pinfo).blakWin
		(*pinfo).img[zi,64:63+zimagedim[0],20:19+zimagedim[1]] = $
			zimage
		tv,(*pinfo).img[zi,*,*]

	endfor

goto,skip

	; Take care of differencing if required
	case (*pinfo).doDiff of
		1:begin
			ev = { id:0L, top:MDACID,handler:0L,select:1}
			MDACOnRdiffRB,ev
		end
		2:begin
			ev = { id:0L, top:MDACID,handler:0L,select:1}
			MDACOnFdiffRB,ev
		end
		else:
	endcase

skip:

	; Set some pinfo variables
	(*pinfo).zm = 1
	(*pinfo).zmf = zmf
	(*pinfo).insel = 0
;goto,done

	; Set Stop/Start to "Stop"
;	id = widget_info(MDACID,find_by_uname='MDACContinueButton')
;	widget_control,id,set_value='Stop',sensitive=1

	; Take timer off hold, i.e. play the movie
;	widget_control,(*pinfo).mdacid,timer = (*pinfo).stallSave
;   (*pinfo).stall = (*pinfo).stallSave
done:
end