Login  Register

determining size of drawn text

Posted by John Alexander-7 on May 16, 2008; 4:13pm
URL: http://imagej.273.s1.nabble.com/determining-size-of-drawn-text-tp3696203.html

Hi everyone -

I am using the drawString() function to print the name of the path/file
I am processing.  The image I am drawing on is of a known size (1300
pixels wide).

The problem is that on occasion I run across a file whos path/name is
longer than the width of the image - and so much of it is not seen.

Currently I use SansSerif size 18.

I would like to calculate the width in pixels of the text string first,
and if it is greater than 1300, use a smaller font size.

Is this possible?

John


--
John K. Alexander, Ph.D.
Post-Doctoral Fellow
William Green Laboratory
University of Chicago
Dept. Neurobiology, Pharmacology, and Physiology
947 East 58th Street
Abott Hall 402
Chicago, IL 60637
(off) 773-702-9386
(fax) 773-702-3774
[hidden email]