Results 1 to 1 of 1
Thread: Printing portion of an image
- 07-06-2009, 02:04 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 11
- Rep Power
- 0
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
Similar Threads
-
Problems drawing a section of an image onto another image.
By Cain in forum Java 2DReplies: 1Last Post: 04-17-2009, 12:44 AM -
[SOLVED] manipulating the pixel values of an image and constructinf a new image from
By sruthi_2009 in forum AWT / SwingReplies: 14Last Post: 04-10-2009, 08:46 AM -
drawing an image to an offscreen image
By hunterbdb in forum Java 2DReplies: 9Last Post: 10-30-2008, 06:17 PM -
remove a portion from a file
By alon2580 in forum New To JavaReplies: 13Last Post: 08-25-2008, 01:45 PM -
Converting multiple banded image into single banded image... Image enhancement
By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks