Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!hplabs!hp-ses!hpcuhb!hpindda!tribby From: tribby@hpindda.HP.COM (David Tribby) Newsgroups: comp.sys.apple Subject: Re: RE: 2 more //gs programming questions Message-ID: <6230040@hpindda.HP.COM> Date: 7 Jul 89 16:42:50 GMT References: <8907011229.AA12157@decwrl.dec.com> Organization: HP Information Networks Group/Cupertino CA Lines: 39 The original poster, Jeff Hartkopf, asked me to be a little more explicit in how I used the GetVisHandle call, so here are more details. The procedure I'm writing plots a waveform from DOC memory to the screen; since those waves can be 32K bytes long, it can take a long time to plot the entire thing, even with plotting only every 8th byte! So I use the size of the visible window to cut back on the amount of plotting that needs to be done. Here's part of the code... { Redeclare GetVisHandle, since TML got it wrong in 1.5 QDIntf} FUNCTION GetVisHandle1: RgnHandle; Tool 4,201; {$LongGlobals+} { Procedure may be called without data reg set properly } PROCEDURE PlotWave(doc_index: INTEGER); VAR ... { Several variables declared } min_h, max_h: INTEGER; { Horiz limits, in local coordinates } vis_region_handle: RgnHandle; { Visible region handle } BEGIN { PlotWave } ... { Get waveform out of DOC memory, determine stepping size, & calculate } { limits of horizontal axis in local coordinates (min_h & max_h). } ... { Determine how much of what we have to plot is visible } vis_region_handle := GetVisHandle1; WITH vis_region_handle^^.rgnBbox DO BEGIN IF left > min_h THEN min_h := left; IF right < max_h THEN max_h := right; END; { Plot the wave in the window } ... END; { PlotWave } {$LongGlobals-} --Dave Tribby ARPA: tribby%hpda@hplabs.HP.COM UUCP: hplabs!hpda!tribby