Article View: borland.public.jbuilder.java.language
Article #17771Drawing large Graphics objects
From: Jeremy Dickson
Date: Wed, 30 Sep 1998 00:00
Date: Wed, 30 Sep 1998 00:00
26 lines
1740 bytes
1740 bytes
Hi, I have a bit of a problem in drawing some components on to a Canvas. I am writing a genetic map viewer that parses and processes a lot of information- to simplify it, it draw lots of lines, strings and boxes on screen in different colours. You are able to streach out the map out so that it is theoretically very long. The problem is that if I paint all these to screen I get a huge image that does not scroll in the ScrollPane very well and crashes the program! I tried setting the clip area in Graphics thinking that anything outside of this area simply would not get drawn on the bitmap but alas, it still makes the huge bitmap and only shows the bit you specified in the clip area! Is this not a short-coming of the Graphics class? Anyway, what I'm looking for is the simplest and most efficient way of rendering this image so that all that is drawn in a call of the paint method is what you can see on the screen. It gets really complicated when you have lines that go off the viewable area as you have to start applying the equation of a line and all that! What I'd like is a solution similar to the way I thought the clip area setting worked! Many thanks, Jeremy Dickson.
Technical Details
Message-ID:
<361219DF.C523C5CB@bbsrc.ac.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,ce16f2acf35027c0,start X-Google-Attributes: gidf74b3,public From: Jeremy Dickson <Jeremy.Dickson@bbsrc.ac.uk> Subject: Drawing large Graphics objects Date: 1998/09/30 Message-ID: <361219DF.C523C5CB@bbsrc.ac.uk> X-Deja-AN: 396306289 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=EUC-KR Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language