[Biojava-l] logo painter

Thomas Down td2@sanger.ac.uk
Fri, 11 Jan 2002 13:31:24 +0000


On Fri, Jan 11, 2002 at 02:21:26PM +0100, Bert Coessens wrote:
> Dear all,
> 
> Does anybody know how to write a graphics object to a jpeg file? I
> already tried almost everything but still with no result. The code
> beneath is what I think should work, but if I run it, I only get a black
> image of 300 by 300. Can anybody tell me what I'm doing wrong?
> 
> * variable dist is some distance
> * sLogo is not a null object, I can visualise it inside a JFrame object

Hi...

I think you to explictly set the size of the logo
you want drawn:

  sLogo.setSize(300, 300);

The LogoPainter code works out the correct size to
draw at based on the size of the DistributionLogo.
Like most AWT components, this will default to size
(0, 0) unless either explictly resized or packed into
a layout.

Hope this helps,

  Thomas.