Article View: borland.public.jbuilder.java.language
Article #19682REPOST: How to create an Image for painting from a non GUI class
From: Morteo, Karl
Date: Tue, 13 Jan 1998 00:00
Date: Tue, 13 Jan 1998 00:00
23 lines
1289 bytes
1289 bytes
Last time I posted this it didn't seem to make it to the list so I'm
trying again...
I am attempting to create a non GUI class with a function the same as
Component.createImage(int width, int height).
The image is created with a call like this
image = Toolkit.getDefaultToolkit().createImage(new
MyImageSource(width, height));
I am using a dummy MyImageSource even though I actually want an empty
width by height image. All seems well unless I try to get the image
'Graphics' with a call to image.getGraphics() which always generates a
class cast exception.
Do I need to perform some kind of image initialisation or preparation
before I can get the Graphics ? If so how ?
Any assistance much appreciated,
Karl Morteo
Technical Details
Message-ID:
<34BB15A9.7EC89C12@iee.org>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34435658.3349@bjssoft.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,800a19b662e9efa9,start X-Google-Attributes: gidf74b3,public From: "Morteo, Karl" <kmorteo@iee.org> Subject: REPOST: How to create an Image for painting from a non GUI class Date: 1998/01/13 Message-ID: <34BB15A9.7EC89C12@iee.org> X-Deja-AN: 315467783 Content-Transfer-Encoding: 7bit References: <34435658.3349@bjssoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: None Newsgroups: borland.public.jbuilder.java.language