Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-06-2009, 03:04 AM
Member
 
Join Date: Feb 2009
Posts: 11
Rep Power: 0
thayalan is on a distinguished road
Default Printing portion of an image
Hello there,

The application being developed allows user to open an image(jpeg) and cloud portion of the image(dotted lines marking the boundary). I am able to print the original full size image on a single page but the question is how do i print only the portion of the image bounded by the dotted lines or the cloud? Basically what I have done is to use drawImage function as follows in the print() block:

g2d.drawImage(componentToBePrinted.getImage(), componentToBePrinted2.getTopLeftX(), componentToBePrinted2.getTopLeftY() , 20 , 30,(ImageObserver) this);

whereby,
componentToBePrinted is an instance of the Diagram class containing reference to the image.
componentToBePrinted2 is an instance of the cloud which contains the coordinates of the dotes.


For your info, the following is the working code to print the entire image:

componentToBePrinted.paint(g2d);

Any hint how to solve it? Thanks
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems drawing a section of an image onto another image. Cain Java 2D 1 04-17-2009 01:44 AM
[SOLVED] manipulating the pixel values of an image and constructinf a new image from sruthi_2009 AWT / Swing 14 04-10-2009 09:46 AM
drawing an image to an offscreen image hunterbdb Java 2D 9 10-30-2008 07:17 PM
remove a portion from a file alon2580 New To Java 13 08-25-2008 02:45 PM
Converting multiple banded image into single banded image... Image enhancement archanajathan Advanced Java 0 01-08-2008 06:29 PM


All times are GMT +2. The time now is 05:03 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org