🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #674

Re: how to get one image's size (width and height) in java or jsp?

#674
From: John McGrath TeamB
Date: Thu, 17 Apr 2003 04:02
18 lines
1502 bytes
On Wed, 16 Apr 2003 11:00:02 +0800, jony zhang wrote:

> how to get one image's size (width and height) in java or jsp? 
> are there some APIS to do this? please tell me how to do it.

You need to make sure that the image has been loaded in order to get 
its dimensions.  One way to do this is to use a MediaTracker.  After it 
has been loaded, the getWidth() and getHeight() methods should return 
the dimensions of the image.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.1907f16d362bd35798bf57@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e9cc715@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,2d070feafdfa19ac
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-04-16 21:07:52 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: how to get one image's size (width and height) in java or jsp?
Date: Thu, 17 Apr 2003 00:02:46 -0400
Message-ID: <MPG.1907f16d362bd35798bf57@newsgroups.borland.com>
References: <3e9cc715@newsgroups.borland.com>
X-Newsreader: MicroPlanet Gravity v2.60
NNTP-Posting-Host: 151.197.11.12
X-Trace: newsgroups.borland.com 1050552165 151.197.11.12 (16 Apr 2003 21:02:45 -0700)
Lines: 18
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail