You Are Here:

Community: Developer Discussion Boards

#1 Old Drawing on an image - 2007-09-25, 17:08

Join Date: Sep 2007
Posts: 5
scottleaw
Offline
Registered User
I'm using NetBeans forms and added an image which is a .PNG file. I am wondering if there is a way that I can draw rectangles on the .PNG file because I read somewhere that images that are files are immutable.

Is there any way I can work around the problem?

Essentially what i am trying to do is display a map (.PNG file) and then draw rectangles on the map to show destinations.

Thx for the help!
Reply With Quote

#2 Old Re: Drawing on an image - 2007-09-26, 10:52

Join Date: Jun 2007
Posts: 534
Location: Mumbai
Send a message via Yahoo to prakash.raman
prakash.raman's Avatar
prakash.raman
Offline
Super Contributor
Hi Scottleaw, Well the image u get from resource will be of type immutable but u can use the following to draw things over it...

Quote:

It is possible to create a mutable copy of an immutable image using a technique similar to the following:

Image source; // the image to be copied
source = Image.createImage(...);
Image copy = Image.createImage(source.getWidth(), source.getHeight());
Graphics g = copy.getGraphics();
g.drawImage(source, 0, 0, TOP|LEFT);
Well check out java doc i got above from there only...

Prakash
Reply With Quote

#3 Old Re: Drawing on an image - 2007-09-26, 19:57

Join Date: Sep 2007
Posts: 5
scottleaw
Offline
Registered User
Thx for ur Help Prakash!
Last edited by scottleaw : 2007-09-26 at 20:09.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a JPEG Image ummarbhutta Mobile Java Media (Graphics & Sounds) 8 2007-02-15 07:34
how to cut some part of Image mshouab Mobile Java Media (Graphics & Sounds) 2 2006-08-04 10:05
Nokia Image Converter davidpurdie General Discussion 0 2004-02-18 16:31
Problem of drawing FLIPPED Image after clipping in Nokia 3510i handset radhesh Mobile Java Media (Graphics & Sounds) 2 2003-12-10 04:29
Series 40 - image resizeing and drawing black and white only a part of an image ionutianasi Mobile Java Media (Graphics & Sounds) 3 2003-07-21 11:36

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ