Quantcast

Maximum PC

It is currently Mon Sep 22, 2014 4:58 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Java graphics
PostPosted: Fri Mar 13, 2009 9:06 am 
Team Member Top 1000
Team Member Top 1000
User avatar

Joined: Wed Jul 02, 2008 1:41 pm
Posts: 252
hi, I want to be able to use Graphics to load a bitmap (or PNG) from the hard disk and scale it to 100% of the window, I have read in different places about reading an image off of the disk and then putting that data into an "Image" data type, I didn't quite understand it, can someone explain an easy way to do this?
Code:
    public void paint (Graphics g)
    {
        super.paint (g);
        int w = getWidth ();
        int h = getHeight ();
       
        //drawImage("image.bmp", 0, 0, w, h);
    }


the image will most likely be larger than the window although I'd like it to work when the image is smaller. I am assuming java has built in methods for scaling


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group