🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1445

Newbie: TImage equivalent?

#1445
From: Andreas Koch
Date: Thu, 20 Nov 2003 21:05
50 lines
2279 bytes
Hi,

for getting started with java/swing, i'd like to build
a trivial pixel orientated app.
Perhaps someone could translate following simple Delphi "source"
to Java to point me in the right direction :-)

---------------------------------------------------------
In Delphi:
Create new app.
Drop TImage1 on Form.
Set Align = Left.
Drop TSplitter1 on Form.
Drop TImage2 on Form.
Set Align = Client.
Code the Formcreate as:

procedure TForm1.FormCreate(Sender: TObject);

var
   x,y:integer;

begin
   image1.picture.bitmap.width:=image1.width;
   image1.picture.bitmap.height:=image1.height;
   image1.picture.bitmap.Pixelformat:=pf24bit;
   for x:=0 to image1.width-1 do
     for y:=0 to image1.height-1 do
       image1.picture.bitmap.canvas.pixels[x,y]:=rgb(random(256),0,0);

   image2.picture.bitmap.width:=image2.width;
   image2.picture.bitmap.height:=image2.height;
   image2.picture.bitmap.Pixelformat:=pf24bit;
   with image2.Picture.bitmap.canvas do
     begin
       brush.color:=clWhite;
       FillRect(rect(0,0,image2.width,image2.height));
       textout(100,100,'This is a test');
     end;
end;

--------------------------------------------------------
In Java:
???


                       thanks a lot,
-- 
                                   Andreas
He screamed: THIS IS SIG!
Technical Details
Message-ID: <3fbd2c76@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,2bbf018dbaca818,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-11-20 13:11:00 PST
Date: Thu, 20 Nov 2003 22:05:59 +0100
From: Andreas Koch <nospam@kochandreas.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Newbie: TImage equivalent?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 80.128.218.70
Message-ID: <3fbd2c76@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069362294 80.128.218.70 (20 Nov 2003 13:04:54 -0700)
Lines: 51
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail