On 2/11/07, Norman Palardy <[EMAIL PROTECTED]> wrote:
On Feb 11, 2007, at 1:15 PM, Peter K. Stys wrote: > I too created a plotting class that draws vectors and caches as bitmap > for speed (includes cursor readout of coord values, delta display ie. > dx, dy between 2 points, lin/semilog, legends, etc...). > > Speed was an issue with a dozen waveforms each having 1000 or more > points. Vectors were too slow for the standard window refreshes, > etc... > > So I create the vector Group2D once from the raw data & render it into > a bitmap; the latter is used in the paint event of the canvas for > speed, unless the data change, then the vectors are rebuilt. > > I can send the opensource class to anyone who's interested. > > P. One of the optimizations to always look at is if the number of points to plot is > the number of pixels in the drawing area then you can only represent some of the items So even if you try to plot 5000 points on a 500 pixel area you only need to plot 500 of the data points that actually fall on distinct integer coordinates It makes things go faster
Quite correct Norm. In fact my class restricts to a max of 500 line segments or so, regardless of nPoints in the data arrays, as far as I recall. I'll email a zip off list later to those who requested. The pdf trick Roger mentions is neat. This begs the question I've raised before: it's now 2007, the Mac's been around for almost 25 years. Why on earth are we not able to COPY-PASTE hi-res vector objects via the clipboard rather than having to go thru a pdf or eps file? My understanding is the PDF has replaced PICT as the standard graphics representation on the clipboard as of OS X. Even if RB could (and it SHOULD!) automatically convert a Group2D into pdf with a simple myGroup2D.copyToClipboard method, I don't know of any commercial apps that will actually recognize this and perform a faithful hi-res paste. Canvas X sure doesn't: I still have to rely on Copy @ 4x PICTs for decent resolution. It's 2007 folks! (or have I been missing something for the last 25 years :-( ) P. -- ------------------------------------------------------------------------------- Peter K. Stys, MD Professor of Medicine(Neurology), Senior Scientist Ottawa Health Research Institute, Div. of Neuroscience Ottawa Hospital / University of Ottawa Ontario, CANADA tel: (613)761-5444 fax: (613)761-5330 http://www.ohri.ca/profiles/stys.asp ------------------------------------------------------------------------------- _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
