Applet prints parts of Java2d image

I am using PrintJob. My applet draws rectangles, then I use shear to draw perspectives.
All drawing is in paint method.
Here is the piece of font where I use it
printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
if (printJob.printDialog()) {
try{                    
printJob.print();}
catch (Exception ex){
ex.printStackTrace();}
To get the screen ready to be printed, I call paint again:
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
if (pi >= 1) {
return Printable.NO_SUCH_PAGE;
paint(g);
return Printable.PAGE_EXISTS;
The result is that I get printed separately each part.
First the rectangles before applying the shear transform, and after that I get the rectangles drawn with shear and transorm.
It seems that the image is drawn in layers and each one is printed separately.
How can I draw the whole image as one single "flat" image?
Thanks.

http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/render.html
The link above is to a tutorial that covers printing. I found it particularly useful especially the part that discusses printing multiple objects. I was having difficulties printing when there where multiple obects involved and this tutorial cleared this issue up for me.
I hope this helps
=)

Similar Messages

  • Print part of image in CS4?

    I recently upgraded from CS3, and I seem to have lost the ability to print part of an image.
    I'm sure that in CS3, if you tried to print an image that was larger than the paper, you got a warning saying it would be cropped, but you could still move the image in the print preview to get the part you wanted. How do I do this in CS4, without cropping?

    You can still do this in CS4.
    In the Print dialog,  Center Image and Scale to Fit Media must both be unchecked, and Bounding Box must be checked.
    Then you can slide the image around in the preview window as much as you like.
    You can also drag the corners of the bounding box in the preview to manually scale the image.
    Unfortunately, many printers will not print an image that extends past the printable area. If this is the case, you'll be able to go past the warning message, but the page will probably come out blank. If you can set your printer to print bleeds, then you can probably print the portion of the image that falls within the printable area.
    (I was also going to explain how to set a pre-sized selection and then print just the selected area, but the "print selected" checkbox in the print dialog seems to be broken at the moment. So here's a pretty useful work-around that you may need to use if bleeds are a problem.)
    1. Select the Crop tool (C / Shift-C) and enter the width and height of your printer's printable area. You can enter "8.27 in" or "2750 px" etc. If you don't know your printer's official printable area, just allow about 1/4 to 1/2 inch of border (e.g., 8 in x 10.5 in for letter size).
    2. Then, in the settings bar, enter a reasonable pixels per inch for your printer (300 should work fine) in the Resolution field.
    3. Then drag the crop marquee over your image and position or size it as you like. Because the Width and Height are not blank, the crop area will retain the correct proportions. Note that whatever size crop area you create, the crop operation scales that portion of your image to the specified Width and Height.
    4. Then press Enter or Return or click the big checkbox on the settings bar. Don't save your document!
    5. Print the cropped document as usual, and after the print dialog closes, press Ctrl-Z (Command-Z) or choose Edit / Step Backwards to undo the crop.

  • Using applet to select a part of an image and then save it

    Hi ,
    I want to use applet to select a part of an image and then save that particular selected part to a server. can anyone provide me a code for this. I have found codes on the sun site which help in uploading an image but I am having trouble in trying to select a part of the image.

    Sorry to get back to you so late, but I was away from my computer this afternoon.
    I'm not sure just what you are after. I do see that you have positioned the tree on the labels. I went to the web site for the label company, and their instructions are not too helplful.
    http://www.pixentral.com/show.php?picture=15sBkl9OZE9xSkHoLMxgwjTFv2VCg1
    I changed the white portion of 1 label to black - - this can be any color. To do this use the magic wand tool, tolerance=10 worked for me, then go to Edit>fill selection.

  • I have an IX6550 which I understand can print up to 563cms images. Trouble is I can't get it to do.

    Hi,  I am new to this forum but really need some help with my Canon IX6550.  I use it on a Mac Mini running OSX.  I use Lightroom and Photoshop CS6
    I understand that it can print up to 563cms images.  I have set up a custom page and when I preview the image it looks great but when I send it to print it prints a small part of the image across the page.  If I change the orientation of the image then if shows only a small part of the image at it's full length.  Any help would be really appreciated.

    Add a valid payment method to your account. That is required even for free apps and app updates. If yo think the payment method is valid contact iTunes:
    Apple - Support - iTunes - Contact Us

  • After Preflighting a PDF, using Convert to CMYK, Flatten Transparency and Prepress Profile Convert to CMYK only the resultant PDF has a grubby halo along the edge of some white type sitting on an image. The type is part of the image.

    I am using a 27" iMac 3.2 GHz Intel Core 5, 8 GB Memory, running Yosemite 10.10.1. 
    The version of Acrobat that I am using is: Acrobat XI Version 11.0.10
    After Preflighting a PDF, using Convert to CMYK, Flatten Transparency (high resolution) and Prepress Profile "Convert to CMYK only" the resultant PDF has a grubby halo along the edge of some white type sitting on an image. The type is part of the image which is 300 dpi.
    It is like the image isn't really 300 dpi but has been artificially boosted to that to avoid being tagged by Preflighting, but when Preflighting the file it knows the original resolution.
    I have screen grabs which illustrate the problem perfectly but do not know how to post them, if indeed they can be.
    Any help or comments gratefully received.

    Without the files and possibly screen prints, it is virtually impossible to assist you.
              - Dov

  • InDesign only showing part of the image

    I'm doing a job for a client in InDesign CS5. I have not worked in CS5 before, so don't know if this is a bug or if I'm doing something wrong.
    It seems to happen randomly and I have checked the preferences and tried using different settings for the Display Performance. I've even tried viewing the job with Overprint Preview switched on.
    When placing images only a part of the image shows. When I output to PDF or Print the file then the entire image shows. This makes it very hard to do layouts, especially in cases where I need to crop an image.
    In InDesign it looks like this:
    When I output to PDF (this is a low res output, just to demonstrate my point) the entire image shows:
    In InDesign it looks like this:
    When I output to PDF:
    The machine I'm ding this job on is an iMac, 2.66GHz Intel Core 2 Duo with 4GB 800MHZ DDR2 SDRAM. It is running Mac OSX 10.6.4. And InDesign is on version 7.0.2.

    mafeiteng wrote:
    I'm doing a job for a client in InDesign CS5. I have not worked in CS5 before, so don't know if this is a bug or if I'm doing something wrong.
    It seems to happen randomly and I have checked the preferences and tried using different settings for the Display Performance. I've even tried viewing the job with Overprint Preview switched on.
    When placing images only a part of the image shows. When I output to PDF or Print the file then the entire image shows. This makes it very hard to do layouts, especially in cases where I need to crop an image.
    In InDesign it looks like this:
    When I output to PDF (this is a low res output, just to demonstrate my point) the entire image shows:
    In InDesign it looks like this:
    When I output to PDF:
    The machine I'm ding this job on is an iMac, 2.66GHz Intel Core 2 Duo with 4GB 800MHZ DDR2 SDRAM. It is running Mac OSX 10.6.4. And InDesign is on version 7.0.2.
    If I understand things correctly, you're placing client-supplied images into a new InDesign file that you're creating, so the only part of the workflow that you haven't created is the graphics. This logically leaves the container file innocent.
    The question becomes "what's up with either the hardware or the graphics?" If the problem persists with the same graphic files and a new container file on a different user account on the same computer, it's possible that hardware is the villain. If it doesn't persist on a different computer, it's likely the hardware. If it does persist on a different computer, in a new container file, it's likely something in the graphics files.
    It's not clear if the graphics card in your iMac is one of the models whose video RAM is "dedicated," that is, it doesn't share video RAM with the main RAM, or if it does share VRAM. If it shares RAM, it's possible that 4GB isn't sufficient to display all the open applications and their demands. If this is the cause, it's a hardware issue (insufficient RAM.)
    Because the graphics print and convert to PDF without the problem, it would seem that the graphics are innocent, but perhaps something in the processing of these outputs causes the problem to disappear. For example, perhaps there's some flattening involved. Perhaps there's a clipping path or channel mask of some kind involved that affects the InDesign display? (Just fishing.)
    Have you tried opening the graphics in their creating application and saving them to new names? Any difference in the behavior when those graphics are freshly-placed in InDesign, or when their links are updated?
    Have you tried placing PDFs of the graphics? If they appear properly, can you crop them to achieve your requirements and hope the problem goes away after the deadline passes<G>?
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Part of imported image remain on computer screen after creating Page doc

    This is strange. I imported a cartoon picture to a Page document. I deleted the document but part of the image (six little dots) remains on my screen. At first I thought it was actually dirt on my screen but it is from the cartoon and it does not go away even after I restart my computer. It shows up whether I am on Page application or on the Internet. I have deleted the picture from my computer, deleted the document and emptied the Trash and restarted computer and the six little dots remain. Any thoughts? It as if I imported a portion of the image as a permanent mark. The dots do not print out and do not show up in a Screen shot picture. So not horrible but irritating. It was part of a Yogi Bear cartoon photo - so make fun of me all you want but I would love to get these dots gone.
    IMac Mac OS X (10.4.6)

    The picture has nothing to do with the little spots on your screen.
    Run a google search on stuck screen pixels.
    S.

  • Is it possible to clone one part of an image into another in iphoto?

    Since it is not possible in Aperture to clone one part of an image into another photo is it possible in iphoto?

    No.  You will need to use an image editor that can handle layers.
    Some Image Editors that support  layers:
    Photoshop Elements 9 for Mac - $79
    GraphicConverter - $45
    Rainbow Painter - $30
    Imagerie - $38
    Acorn - $50 Pixelmator - $60 
    Seashore - Free
    Portraits and Prints - Free
    GIMP for Mac - Free
    Of those I believe you get the most bang for the buck with PSE 9.  The following are some of the advanced editing you can do with it:
    Click to view full size
    Click to view full size
    Additional possible candidates for editors can be found by searching for "edit" at MacUpdate.com.
    OT

  • Printing Questions - "Poster" - One image on multiple sheet of paper (to create an enlargement)

    Hello,
    Tried to find this in the archives - apologies if this has already been answered. Kindly reply with that link and I won't ask you to chew your cabbage twice...
    On my older PC, I used to be able to print an image in "poster" mode, which essentially let me print and enlarge an image by printing it across multiple pages (e.g. 4, 6, 9 pages.) Since I'm a painter, this was an easy way for me to print out an image - and enlarge it - from which I could tape the pages together to create the enlargement. I then could use that rough poster-enlargement-on-multiple-sheets-of-paper to trace on to my canvas. (And my photographer friends have already pointed out the ease of which to actually print poster size images, but I don't need that expense or hassle for my purposes. I basically want an enlargement to trace onto a larger size canvas to paint on.)
    Since I just got a new Mac, I've downloaded PSE9 Mac trial, but can't for the life of me figure out how to replicate what I used to do on my PC, granted with an older version of PSE.
    Hoping this makes sense - and hoping against hope that someone can nudge me in the right direction...
    Thanks!
    Greg
    BTW - IF this does make sense, AND I can do on the Mac or the newer version of PSE - anybody got an idea for a workaround? (Short of buying PS CS5...?)

    Juergen,
    Thanks so much! Of course you're right - and this does the job perfectly! Thank you so much for the prompt replay, explained clearly, and very helpful! You've really helped me move onto items which I've really wanted to do!
    Very gratefully,
    Greg

  • How can I use applet to get the desktop image of client

    hi,I have a question to ask u.
    How can I use applet to get the desktop image of client? Now I develop a web application and want user in the client to get his current image of the screen.And then save as a picture of jpeg format ,then upload it to the server?
    I have done an application to get the screen image and do upload file to server in a servlet with the http protocal.

    Since the desktop image is on the client's local hard drive, you'll need to look at trusted applets first.

  • How can I select only a small part of the image to clone or edit etc?

    I want to select part of the image to clone is, and just edit the selected part. I know i can do this on photoshop but how do i do it on Aperture?

    You use the "Retouche" brush in Aperture and set it to "clone".
    Option-Click on the location you want to clone from to select a source, and then brush over the location where you want to clone to. The cloned region will follow the shape of the brushed area. You do not lasso the shape to to copy and paste it like in Photoshop.
    For example: Duplicating a penguin: The sourcepoint has been set to the beak of the second penguin, and then I brushed along the path where I want to penguin clone to appear.
    If I brush the whole area eventually the penguin will be copied completely. You'll have to experiment a bit with the brush size and softnees to ensure that the cloned object will blend in.
    Regards
    Léonie

  • I have Office 2011 which includes Word.  Ever since downloading Mavericks, when I try to send a two-page word document, some recipients get only one page.  Also sometimes when I burn an image from iPhoto on to a disc, only part of the image appears.  Why?

    I have Office 2011 which includes Word.  Ever since downloading Mavericks, when I try to send a two-page Word document by email, some recipients get only one page.  Also when burning an image from iPhoto (usually no larger than 1mb) on to a disc, only part of it appears.  It appears to have been magnified so that only a part of the image appears.  Can anyone enlighten me as to what is happening?  And how to fix it??

    I have Office 2011 which includes Word.  Ever since downloading Mavericks, when I try to send a two-page Word document by email, some recipients get only one page.  Also when burning an image from iPhoto (usually no larger than 1mb) on to a disc, only part of it appears.  It appears to have been magnified so that only a part of the image appears.  Can anyone enlighten me as to what is happening?  And how to fix it??

  • My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need t

    My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need to. It appears as if I selected the entire layer on purpose (which I did not)
    The below items appeared when I opened Photoshop CS 5:
    “Photoshop has encountered a problem with the display driver and has temporarily disabled G & U enhancements. Check the video card malfunctions website for latest software. GPU enhancements can be enabled in the performance panel of preferences.”
    (I believe this started after the automatically updated Windows was applied. It was coincident with the before mentioned problem . . . but I don’t really know if it had anything to do with it. )

    For the Clone Stamp problem, check the Clone Source panel and Clipped is probably unchecked.
    If so, check Clipped and see if that makes a difference.
    (Window>Clone Source)
    As to the video card problem:
    Which version of windows are you using?
    What is the make and model of your graphics card?
    Do you know which update windows installed?

  • My Deskjet D1660 won't print part of my Word document

    Please help me!
    Yesterday I struggled for three hours to print black until I found out the cartridge ink was clogged, I cleaned it and that solved it.  I've got a HP Deskjet D1660 and my laptop is Windows 7.
    But today I was printing part of a Word document (page 24 onwards) and it just printed a couple of pages. It won't print page 26 onwards! printer says there is nothing in the queue and that the printer is ready. I've tried everything I could think of...... please help me; I think the problem is not the printer as it would printer anything else, including other Word documents. It must be something else, I just don't know what! :'(

    Hello Moyo1,
    Welcome to the HP Support Forums!
    First off, I am glad to hear you have been able to clear the clogged ink jet that was preventing the Photosmart D1660 from printing black. Regarding the current issue, not printing past a set page number, let's try and fix this for you.
    Since you have a Windows Operating System, run the HP Print and Scan Doctor. This will look into driver, software and communication problems that could be causing this.
    Let me know the results, what passes, fails, etc and I will be looking forward to hearing back from you.
    Cheers,
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • How do you cut out the part of an image in a photo?

    How do you cut out a part of an image on a photo that you have added to Pages. For example, if I have added a picture of a giraffe to Pages how would I cut out the giraffe from the image and get rid of the rest of the image

    You can use the instant alpha tool to make the background transparent.
    FYI: Pages is part of iWork, not iLife.

Maybe you are looking for

  • Is anyone having problems with music in 6.1.1?

    I updated to 6.1.1 and now my music looks like the album option in iTunes. Has anyone else had this problem? It's almost un-usable.

  • Airport Extreme Compatible Printers - How can you tell by the printer spec?

    Hi, If a printer spec says Mac OS X v10.3.9, 10.4 compatible am I safe in assuming it has drivers for Airport Extreme? If not how can I be sure? I'm trying to replace an old printer that doesn't work very well or have drivers specifically for the Air

  • Stateful Session Bean with BMT: JDBCpmf or EEpmf?

    Quote: For the record: when using BMT as David described, you should use a JDBCPersistenceManagerFactory instead of an EEPersistenceManagerFactory. EEPersistenceManagerFactory is only appropriate when transaction synchronization is desired. -Patrick

  • OAS w/Remote 8i database

    I've installed OAS 4.0.8.1 on NT sp5 connecting to an 8i db on a Sun box. I am able to bring up xml type docs via the browser, however when I attempt to access the db I get http 500 internal error.

  • Single OSB Proxy Service Listening to multiple MQs

    Hi All, I am using OSB 11.1.1.5 and Websphere MQ version 6. I have a requirement to make a single proxy service to listen to multiple MQs. Is this possible? If yes, please help. If no, what is the work around? Regards, Karthik