Resizing and Printing a bufferedImage.

I have a bufferedImage , and I was wondering if somebody could supply me with a method to resize it to the paper size and print it out with out asking the user anything. Except are you sure you want to print? This would be of great help!

Use AffineTransformOp.
Here is my code
//create an affinetransform (methods to set scale and rotation - I'm setting values directly)
AffineTransform image_at=new AffineTransform(Trm[0][0],Trm[1][0],Trm[0][1],(Trm[1][1]),0,0);
//make an imageOp
AffineTransformOp flip= new AffineTransformOp(image_at,hints);
//apply the opt to current image and put result in temp_image
temp_image=flip.filter(current_image,null);
MArk

Similar Messages

  • Resizing and Printing a .svg File

    I have a svg file that's a map that I downloaded from OpenStreetMap.com. 
    What I'd like to do is divide map into sections, rearrange them and then increase the size of it up to 6 feet in diameter and print it. 
    Is all of this possible to do with an svg file?
    And if so, what tools do I use?  Do I use the Scale Tool?  Or resize the Art Board.
    Any help or advice would be appreciated.
    Thanks

    Chris,
    When you bring vector artwork into Illy, you may use the tools on it, so it should be possible. Why not try?
    Exactly which tools are usable/suitable depends on the actual structure and upon the desired appearance; and how little/much work you are willing to put into it.

  • Resize and print a large image in a report

    A current project I'm working requires that a "report" be printed out for every "part" produced.  
    Each "part" is photographed and a high quality (large) .jpg file is
    generated and cataloged on the hard drive.  A report with this
    image is then printed and shipped with the product as part of a QA
    process.  
    Initially I used a command line argument to have Irfanview print the
    image only.  This was so easy.  Even printing in Landscape
    was simple.  Of course then I realized I would probably need a
    little more information than just the image.  
    Looking at some examples of report generation and reading some of the
    problems others have had in the past, I figured it might be good to ask
    before I go stumbling around in the dark.  
    The original images are 2288x1712 in size.
    Is there any way to auto resize an image to "fit" onto a printed report?  
    The only way I can think to do is to experiment with different sizes
    until I find something that fits and looks alright, then use either
    IMAQ tools or an Irfanview command to resize the image before appending
    it to the report.  
    If anyone has any tricks for this one, I'd love to hear them.  
    Patrick Allen

    Here, but like I said, it's a very stupid VI. It doesn't do any avareging or smoothing and it has no mathematical optimization (assuming that there is any). It just removes some of the elements. This has been good enough for displaying images, but might not be good for anything else, because you lose a lot of details.
    Try to take over the world!
    Attachments:
    Resize.llb ‏98 KB

  • Resizing and printing a photo

    Hello all.Could someone please tell me how to use the printer window in Preview to resize a JPG photo.I want to make the photo larger.I have a Mac Pro with Snow Leopard as my operating system.Thank you.

    Use AffineTransformOp.
    Here is my code
    //create an affinetransform (methods to set scale and rotation - I'm setting values directly)
    AffineTransform image_at=new AffineTransform(Trm[0][0],Trm[1][0],Trm[0][1],(Trm[1][1]),0,0);
    //make an imageOp
    AffineTransformOp flip= new AffineTransformOp(image_at,hints);
    //apply the opt to current image and put result in temp_image
    temp_image=flip.filter(current_image,null);
    MArk

  • Creating and printing a BufferedImage with Robot class

    I use class robot to create a bufferedImage of a screenCapture.
    But all it keeps printing is a black box.
    What am I missing here?
    Dimension dim = mainPanel.getSize();
    Robot robot = null;
    try{ 
           robot = new Robot();
        final BufferedImage bufferedImage = robot.createScreenCapture(new Rectangle
                                               (mainPanel.getLocationOnScreen().x,
                                                mainPanel.getLocationOnScreen().y,
                                                dim.width,
                                                dim.height));
        catch( Exception e ){}     
            PrintUtilities.printImage(bufferedImage);Printing code
    public class PrintUtilities implements Printable{
              private BufferedImage bufferedImage;
      public static void printImage(BufferedImage c) { 
              new PrintUtilities(c).print();
      public PrintUtilities( BufferedImage bufferedImage ){
             this.bufferedImage = bufferedImage;
      public void print(){
             PrinterJob printJob = PrinterJob.getPrinterJob();
             printJob.setPrintable(this);
               if (printJob.printDialog())
                try {
                      printJob.print();
                      System.out.println("calling printjob " );
                catch(PrinterException pe)
                       System.out.println("Error printing: " + pe);
    public int print(Graphics g, PageFormat pf, int pageIndex){
                 Graphics2D g2d = (Graphics2D)g;
                 int imageWidth = bufferedImage.getWidth(); //width in pixels
                 int imageHeight = bufferedImage.getHeight(); //height in pixels
                 g2d.drawImage( bufferedImage, 0, 0, (int)pageWidth, (int)pageHeight, null );
                 return Printable.PAGE_EXISTS;
              }

    Ok, day 4 of working on this. Dukes are still up for grabs.
    I created a small pop up frame in the print method of the print Utilities class to display the buffered image, worked fine. So the problem seems to be in the drawImage()
    Someone has got to have a clue as to why this just printing a black box
    The call to the print class:
    PrintUtilities.printImage(bufferedImage);
    The entire print class:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    import java.awt.image.BufferedImage;
      public class PrintUtilities implements Printable{
              private BufferedImage bufferedImage;
      public static void printImage(BufferedImage c) { 
              new PrintUtilities(c).print();
      public PrintUtilities( BufferedImage bufferedImage ){
             this.bufferedImage = bufferedImage;
      public void print(){
             PrinterJob printJob = PrinterJob.getPrinterJob();
             printJob.setPrintable(this);
               if (printJob.printDialog())
                try {
                      printJob.print();
                catch(PrinterException pe)
                       System.out.println("Error printing: " + pe);
      public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
         Graphics2D g2d = (Graphics2D)g;
         int panelWidth    = bufferedImage.getWidth(); //width in pixels
         int panelHeight   = bufferedImage.getHeight(); //height in pixels
         double pageHeight = pf.getImageableHeight(); //height of printer page
         double pageWidth  = pf.getImageableWidth(); //width of printer page
         if( pageIndex >= 1 ){
              return Printable.NO_SUCH_PAGE;
                // shift Graphic to line up with beginning of print-imageable region
          g2d.translate(pf.getImageableX(), pf.getImageableY());
          g2d.drawImage( bufferedImage, 10, 10, (int)pageWidth, (int)pageHeight, null );
          return Printable.PAGE_EXISTS;
    }// close print class.

  • Scan and print

    elements 9 let me scan directly from my printer, resize and print in a few steps. Elements 11 won't let me scan from my printer, won't let me resize to print. How did I lose this capability by "upgrading"?

    To scan in the editor in PSE 11, you need to install the TWAIN plugin:
    http://helpx.adobe.com/photoshop-elements/kb/twain-installed-photoshop-elements-11.html

  • When I try and print an "Approach Plate, or Departure" from ForeFlight to my Epson Stylus NX430 using AirPrint the image is resized. How can I print without it resizing. I want to have the plate print in the original size so I can use it.

    When I try and print an "Approach Plate, or Departure" from ForeFlight to my Epson Stylus NX430 using AirPrint the image is resized. How can I print without it resizing. I want to have the plate print in the original size so I can use it. Is this an Apple, Epson, or Foreflight Issue? I just purchased the printer so I can return it and get a different model or brand. I spoke to Epson and the suggestions given did not resolve the issue. I have cut the paper down to the size of the plate roughly 5.5x8 and it still try's to print at 8.5x11. I have also requested help through ForeFlights Tech help but have yet to receive an answer.
    Please help!

    It varies based on what you ordered and whether it is in stock or has to be assenbled and shipped from China. Your email conformation should give an estimate of when the items are expected to be shipped or available for pick up if you are having it sent to a local Apple Store.

  • Print preview and print doesn't show the correct out put result when i connnected with EPSON LX-300+II

    I hava an html webpage with css & print css. The print preview and print doesn't give correct output there is alignment problem when i connected with EPSONLX-300+II. But iam connected with hp laserjet they show the correct output with firefox. Please fix the problem as soon.....

    I have same problem as you, but later I know how to deal with it.
    1. change your print default preferences to
    print quality into (120x144 dpi, or other which suites you)
    mine goes well to 120x144 dpi
    2. Before print enter File->Page setup, set true to option shrink to page width
    in order to fit your page into your desired paper
    (firefox will resize your content to suit the paper you choose).
    If you dont want this you can disable this option.
    3. Still in Page Setup, if checkbox "Print background (color & images)" is unchecked then
    white text will be printed black.
    Set this checked if you want to print white text as it is color.
    I hope it answers your question.
    Steve
    http://www.dailymobilegames.com

  • CP5 and Print output

    I'm packaging some PPTs used for ILT using Captivate.  The package is going to include an .exe version and two handout versions.  One for students and one for instructors.  Has anyone attempted to add or modify the templates for the print output?
    I've just tried to use the Handout Template and it has everything scrunched in the center of the page. 
    When I use this as a handout for students I'd like the graphic more over on the left and more room for longer lines on the right for student notes.
    I'd also like to use the handout format with the slide notes for an Instructor's Handout.
    Any help would be appreciated.
    Thank you,
    Susan

    Susan then asked, "Since I've not written macros do you have a good source for learning how?" and I sent the following reply:
    "Try this link as a starting point: http://msdn.microsoft.com/en-us/library/dd721892(v=office.12).aspx
    However, I must forewarn you, to customize your Captivate documentation your macros will probably need to manipulate images, resizing and/or repositioning them. For that, you will need to learn how to use Visual Basic for Applications (VBA) to manipulate Microsoft Word's "Shapes" and "InlineShapes" collections. Initially, all the slide images in the Word document that Captivate produces are inline shapes, attached to the Word paragraph in which they occur. You can resize an inline shape, but you can't reposition it directly. You can either adjust the position and alignment of the paragraph to which it is attached, or you can convert it to a regular Shape whose position can be controlled independently of nearby text. The following procedure is one I use to position the first slide by itself on the first page of the Word document:
    Sub FloatPicture1()
        Dim iSlideCount As Integer
        Dim oILS As InlineShape
        Dim oFloatingShape As Shape
        iSlideCount = ActiveDocument.InlineShapes.Count ' this line just shows you how to find total number of pics in the document
        Set oILS = ActiveDocument.InlineShapes(1) ' this line sets up a convenient reference to the first picture in the InlineShapes collection
        With oILS ' the "With" to "End With" block lets us do multiple actions on the referenced object
            .Select ' If we hadn't done the "Set oILS" and "With oILS" steps, we would have had to type this line in full as:
                        ' ActiveDocument.InlineShapes(1).Select
                        ' and the following line as Set oFloatingShape = ActiveDocument.InlineShapes(1).ConvertToShape
            Set oFloatingShape = .ConvertToShape
        End With
        With oFloatingShape ' Now that we have floated the shape, we can set its position
            .RelativeVerticalPosition = wdRelativeVerticalPositionPage           ' these settings control how word will interpret
            .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage    ' the .Left and .Top values that follow.
            .Left = CentimetersToPoints(2)
            .Top = CentimetersToPoints(6.5)
        End With
        Set oILS = Nothing ' just some VBA housekeeping here, now that we have finished with these objects
        Set oFloatingShape = Nothing
    End Sub ' FloatPicture1"
    By the way, note that when we converted InlineShape #1 to a floating shape, that would have reduced the count of InlineShapes by 1, and what was previously InlineShape #2 is the new #1. Your code may sometimes need to take that change of numbering into account.
    Trevor

  • Why do my resized images print out original size?

    i understand how to resize images (somewhat). however, when i print them, they are printing as original size. what do i have to do to correct this? i have searched the web in vain, am just not finding info. everything is about resizing only. i am using picture manager. have also tried with paint and photo gallery or something. no one in this house is very computer saavy, PLEASE HELP!!!

    Thankyou for your response! Still in need of help!  
               I am making a craft project. I have resized my image exactly how i want it to be to fit my project base. (No standard sizes work). I made the image smaller, to fit exactly on my base (a heart). I saw there were even templates with a heart, but have not figured that out yet. I used the percentage button to resize my image, with the ratio set to keep the dimensions correct. I saved the resized image. Then I opened it and printed it. It was smaller, but still not right, not how I have it on the screen and not the right size. It is too big for my heart and wouldn't work. I know it must be something simple, some little step I am missing. I need to know how to tell the printer the new size. I am using picture manager. I have a HP Photosmart Plus B210 series printer. I have picture manager, paint, hp photo viewer, windows photo viewer, media center, photo gallery. I don't understand why resizing, saving, then opening that file, still did not work. It still printed out (smaller than original but) not the size I needed. I also edited the image and saved it with a new size, and my editing changes.
           This is truly driving me insane! I have spent hours and hours trying to figure it out for myself, as well as searching the web, and asking for help from different forums. (Not to mention wasting lots of ink!??!!!!)
                                                         I Truly would appreciate any help,
                                                                          SINCERELY,
                                                                          lamblovegirl    

  • Leopard's Preview and print size of JPG

    Why doesn't Preview print the actual size of JPGs? Under tools in Preview's file menu, a JPG's size can be adjusted. However, these size settings don't seem to reflect the size of the printed picture. If the scale for printing is set to 100%, the size does not match the actual size of the photo. Any suggestions or explanations?
    Thanks,
    Joseph Strong

    Are you saying that the print preview on the print menu dialog doesn't match with what will actually print, but if you print at 100% it will print at the size expected? I didn't actually try that. What I did was pick a scale % that gave a print preview (on the print menu dialog) that looked about right and printed that way. It worked, but that seems like a pretty hokey way to do it. If I resize using Preview and then import the resulting JPG file into another graphics program, the sizing is perfect. The problem seems to be that when printing from Preview the program wants to automatically fill the printed page with the graphic, and I can't seem to tell it not to. I just want the actual image size.
    Thank you,
    Joseph Strong

  • When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    You want to view the image at the Print Size, which represents the size that shows in the Image>Resize Dialog.
    View>Print Size
    Since screen resolution is almost always lower that the print resolution (somewhere between 72 and 96 usually), images will always look bigger on the screen, unless you view them at print size.
    (apple Retina displays have a much higher resolution than normal screens, closer to the average print size resolution)
    more info:
    Photoshop Help | Image size and resolution

  • Resize and Resample in Photoshop CC

    Hi.
    I use Photoshop since 1997 and jump from CS5 to CC this week. What I used to do sometimes is taking a 150dpi image and need to make it 72dpi, BUT I really want it to change pixels dimension. In PS CS5 I just needed to go to "Image Resize" and change 150 do 72dpi, and PS kept the Cm/Inches dimensions but changed pixels. Is exactly what I need to do. I PS CC it doesn't work, if I change dpi it will only change image size in Cm/Inches.
    And example, I have an Illustrator file, 800x800px. I export it as 150dpi JPG, opens in PS. It will show an image like 1667x1667px 150dpi. I want to change it to 72dpi so my JPG will be 800x800px again.
    Some people will say: "but why don't you already export from ILL as 72dpi?". Because I sometimes need those images in 150 and sometimes in 72. So I prefer to have a 150dpi image and resize to 72 if I need instead the opposite.
    Do you know if there is a way in PS CC to solve it?
    Thanks,
    Luiz

    DPI PPI  and an image's DPI resolution setting and Inkjet Printers DPI Resolution setting ???
    Dots Per Inch is an old printers term that came about when images were printed black and white using little dots of inks fined dots finer sharper images it density of dots size of dots image like news papers.  Later color image usinf 4 colors CMYK...
    Pixels Per Inch a term use about displays color pixels are three color Red Green Blue their geometry layout varies and some have even added a fourth yellow component  again its a density size display are manufactured with a single PPI density.  Different displays panels have their manufactured PPI. Most desktop LCD panels today have a ppi around 100.  Displays do not support your Image Files DPI resolution setting the display pixels their PPI size.  Image sizing on displays is done by scaling  the numbers of pixels in a image a displaying the scaled image not the actual images pixel. Zooming percent....
    Inkjets printers do not print like news papers and the do not use a single drop or dot of ink per image pixel.  The user their higher finer drops of ink to paint in you images larger square pixels. You inkjet printer can print pixels and siy up to the maximum resolution. Your printer DPI setting is a quality setting the higher the setting the finer the pixels will be painted in.  Higher quality settings are only available on high quality Photo paper for more ink is laid down and requires a special surface to prevent ink running pixels together regular paper would receive to much ink and be more a blotter paper.
    Image DPI setting defines/sets the image Pixel size without changing a single pixel in am image you can print the image any size you want by changing the size of its pixels.

  • Pages_Document resizes when printing with Comments showing

    I just upgraded to Leopard and also have the latest version of Pages installed. I just went to print out of Pages to my printer (Ricoh Aficio MP C3500) and the weirdest thing is happening. On Tiger I was printing fine with the Comments showing. Now, I'll click on the Print button, the dialog comes up fine. When I click on anything in the dialog box or change a drop down item, the preview resizes the document. The clincher is that the document prints out resized as the Preview shows it. If I keep clicking the Preview keeps getting smaller and smaller... and it will print as small as the Preview shows. I've printed an 8.5 x 11 document the size of a postage stamp.
    Anyone having this same problem printing with Comments turned on? Any fix?

    I also have this problem. As an attorney I need to be able to print out the document with the Markup (Change Bubbles) showing.
    When I have the change bubbles showing, no matter what options I have chosen in the print dialog box, the document prints out at about 1/16th the size of the original on the paper. If I print to PDF, the same thing happens in the PDF file.
    I like the track changes feature, but this is almost enough to make me go back to Word.
    One work around is to export the document to Word and print with Markup showing from within Word.

  • How to select and print calls only made and receiv...

    how to select and print out list of calls made and received for the past year, between myseld and one particular contact

    While I'm not sure about what you want to accomplish, I'll offer a couple of possible solutions.
    1. If the items that you want to remove are on the timeline, and those items are in layers that contain no content that you want to keep, then you can just select those layers and delete them.
    2. If you want to remove some items from the stage, but keep the original items for some later purpose, just copy the movie and then edit the copy as in item 1.
    3. If you need to remove some items from stage and then resize the stage to compensate for the loss of these items, then you may have to move and/or resize some of the items in your movie. This may be as simple as using the "edit multiple frames" selection in the timeline, or it may be much more time consuming.

Maybe you are looking for

  • Can a method be an input parameter?

    inside ActionPerformed(ActionEvent e) {   Object src = e.getSource();      PlcManager.setWaitCursor(this);        try{           if(src == getBtnInquiry()){                     onActionInquiry(true);                saveLogFile();      } catch (Except

  • How to stop Text messages being commingled with iPhone

    Help. Child's iPod was restored to factory settings and now iMessages  are being received simultaneously on this device and spouse's iPhone ...that should only be destined for iPhone. Also vice versa. How to address this in settings? Thanks,

  • Central web authentication

    I have downloaded the new Cisco ISE, I've managed to configure 802.1x and MAB succesfully but I want to configure wired centralized web authentication, but I cannot find any documentation how to configure ISE and Cisco Catalyst (IOS) switches to use

  • Where can I find the stabilization tool in the latest version?

    I used to find it under Distort but now I don't see it anywhere. Help please!

  • My prepaid account is messed up

    I make a "payment" which is really just verizon asking how much money you want to give them and then they send you at text saying we took your money. I payed what my plan costs. But on my account it just says current balance 4 dollars. I've had that