πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Save JFrame Canvas to gif/jpeg?

#744
From: GG
Date: Mon, 09 Dec 2002 17:33
39 lines
2348 bytes
I think, to do what you want, you should do
1) create a image of your Canvas
2) Save the image

1)create the image
   a) create a BufferedImage whith the same size of of Canvas. So you have a
empty image
   b) paint the Canvas in the image :
      canvas0.paint(image.createGraphics());

2) to save search about "jai",

GG

"Valentino Kyriakides" <vkyriakides@lweb.de> a οΏ½crit dans le message news:
3debd513@newsgroups.borland.com...
> I'am not sure about this, but maybe the "java.awt.Robot" class is helpful
> here in conjunction with java's gif file saving capabilities. See:
> http://developer.java.sun.com/developer/TechTips/2000/tt0711.html
>
> See especially the "createScreenCapture(Rectangle screenRect) " method:
>
> http://java.sun.com/j2se/1.3/docs/api/java/awt/Robot.html
>
>
> -Valentino
>
> "Werner Nussbaumer" <w.nussbaumer@datacomm.ch> schrieb im Newsbeitrag
> news:3DEBC851.CCA210B7@datacomm.ch...
> > How can I save the displayed canvas of a JFrame into a file (gif or
> > jpeg)?
> >
> > Is there a function in JDK 1.3.1?
> >
> > Thanks a lot in advance
> > Regards
> > Werner Nussbaumer
>
>
Technical Details
Message-ID: <at2jse$6ss$1@news-reader10.wanadoo.fr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!fr.colt.net!fr.clara.net!heighliner.fr.clara.net!news.tiscali.fr!proxad.net!wanadoo.fr!not-for-mail
References: <3DEBC851.CCA210B7@datacomm.ch> <3debd513@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,17e8fd44e6efbd7c
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-12-09 09:28:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!fr.colt.net!fr.clara.net!heighliner.fr.clara.net!news.tiscali.fr!proxad.net!wanadoo.fr!not-for-mail
From: "GG" <GerardBourriaud@wanadoo.fr>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Save JFrame Canvas to gif/jpeg?
Date: Mon, 9 Dec 2002 18:33:46 +0100
Organization: Wanadoo, l'internet avec France Telecom
Lines: 41
Message-ID: <at2jse$6ss$1@news-reader10.wanadoo.fr>
References: <3DEBC851.CCA210B7@datacomm.ch> <3debd513@newsgroups.borland.com>
NNTP-Posting-Host: anantes-102-1-4-89.abo.wanadoo.fr
X-Trace: news-reader10.wanadoo.fr 1039454926 7068 80.15.17.89 (9 Dec 2002 17:28:46 GMT)
X-Complaints-To: abuse@wanadoo.fr
NNTP-Posting-Date: 9 Dec 2002 17:28:46 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700