Using Printable with an Image 5TH POSTING

I am trying to print out an image with the following code:
public class print_panel extends JPanel implements Printable{
Image the_image;
public print_panel(Image i){
the_image = i;
public int print(Graphics g, PageFormat pf, int p) throws PrinterException{
if(p>=1) return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D)g;
g2.translate(pf.getImageableX(), pf.getImageableY());
g2.drawImage(the_image, 0, 0, null);
paint(g2);
return Printable.PAGE_EXISTS;
}//end class
All the printer does is spit out a blank sheet. I can get this to work with a swing component, such as a JButton, but somehow it will not print out an image. What more needs to be done?

Hello
I struggled with the same problem. In the Graphics2D Forum is a thread that solved the issue for me (http://forum.java.sun.com/thread.jsp?forum=20&thread=160408).
It seems that Graphis2D.drawRenderedImage(RenderedImage img,AffineTransformation at) is the trick to let the printer know...
Hint: BufferedImage is a implementation of RenderedImage.

Similar Messages

  • Using DisplayPixels with different image formats

    According to the comments in PIGeneral.h (in the PSPixelMap declaration), the DisplayPixels function can handle only grayscale, RGB, CMYK, and Lab images, plus Duotone and Indexed if it matches the document's format (presumably because the function wants to use the palette from the document). I have a multichannel image that I'd like to draw.
    The question is, is there any way to get Photoshop to convert this to a usable format for me? Since I don't know the channel characteristics, I don't think I can do it myself. Alternatively, is there a way to deduce the conversion from the ReadChannelDesc structures in the FilterRecord? Does anybody have code to do this?
    Thanks,
    Aaron

    Hi Mathias,
    this is not possible issuing just one request. You would need to repeat the request changing the format.
    Joao

  • Can't use layers with RAW images

    I am using Photoshop Elements 10 and I can't use layers on RAW format images.  I'm thinking I must have something set incorrectly.  They open in the RAW adjustment window but when I select Open all the layer options are just greyed out and unavailable.
    Any ideas?

    In the camera raw dialog you probably have the Bit Depth set to 16 bits/channel.
    Change the Bit Depth to 8 bits/channel
    (bottom  middle of camera raw dialog where is says Depth)
    You can also change the bit depth once in photoshop elements 10 by going to Image>Mode and clicking on 8 bits/channel

  • I get no sound from my guitar when using iRig with my iPod 5th gen (iOS 7)

    I've just bought my iRig and it doesn't work with my iPod 5. I get no sound out of my guitar.
    Headphones are working and when iRig is connected I can hear the samples and every other sound coming out of the iPod, but I get nothing from my guitar.
    I tried shutting the iPod down, turning Mono on/off, but it still doesn't work with any of my apps (Amplitube, Garage Band and AmpKit).
    Then I tried it with my brother's iPod 4 and it worked perfectly, which makes me think that there's something wrong with my iPod settings (I got the iOS 7)....
    Does anyone know something I could try?
    Thanks!

    iOS: Troubleshooting applications purchased from the App Store
    Contact the developer/go to their support site . Maybe it is not compatible with the 5G iPod. Also, it may not be compatible with iOS 7. Did it work on the 5G before iOS 7?
    Restore from backup. See:
    iOS: How to back up              
    Restore to factory settings/new iPod

  • RMI with SSL problem (cross post under RMI too)

    Hi,
    I'm having problems using RMI with SSL. I posted in the RMI forum originally but now realise the problems are with the SSL really.
    Perhaps someone who follows this forum could help.
    See post:
    http://forum.java.sun.com/thread.jsp?forum=58&thread=409347
    Thanks.

    There's more dukes in the other thread too.

  • Removing Color Cast with TIFF images?  (PSE 8)

    Hello,
    Hoping someone can help.  I'm trying to "remove color cast" with TIFF images and I'm not seeing the option as available.  It works fine when I try to use it with JPEG images.
    To be clear....I'm using PSE 8...after opening a picture (of course), on the top menu "Enhance", then "Adjust Color".  When I'm working with a TIFF image the option "Remove Color Cast" is not available/active.  It works fine with JPEG images.
    What am I missing?
    Thanks,
    Rich

    Alternatively if you want to keep the file at 16 bit click File >>Open As >>Camera Raw
    Then use the temperature and tint sliders to edit your tiff.
     

  • How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    It sounds like you are talking about the cloning tool?
    Tool looks like this:
    Then when selected you can change the size of the brush and using Alt (windows) and Command (Mac) to select your region you want to copy then start to create you cloned image.
    Hope this helps?

  • Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked.

    Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked. I have tried on a windows and a mac and noticed no change. I have tried restoring to a backup but that didn't help. I haven't had time to do a full restore but I will try if the problem persists.

    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • Using PDF's with Webcenter Imaging

    Hey
    We are installing an automated AP solution using WebCenter imaging and our client has dictated that invoices must be scanned to PDF to comply with State Govt requirements. However, this conflicts with our IPM build as we are using WebCenter Capture and it only inputs invoices in TIF format. We have told them that we can scan to TIF and output PDF using the ODC/OFR, or by converting them using IBR when the image hits WCC. The Record Manager is adamant though, and this conversation is ongoing.
    In the meantime, I am trying to think laterally to find a technical solution. The only two ideas I have so far are:
    1. Use Import Server to conver scanned PDF's to TIF before batching them up.
    2. Use a third party solution to create a TIF copy of the PDF after scanning.
    I'm not really happy with either idea, so I thought I'd seek the advice of the collective. Surely this must be a common-ish problem.
    Cheers,
    A

    Hi Alec,
    to be precise, ODC allows inputs (in a scan profile) of TIFF, JPEG, PCX, or BMP (see http://docs.oracle.com/cd/E10316_01/capture/odcad.pdf page 11-4)
    If you have images already in PDF (I guess it will be PDF/A with textual layer), the first question is: why you want to use Capture at all? Is it because you want to extract some metadata from the image? Maybe, you could, then, use OutsideIn to convert PDFs into XML (or plain text) and get your metadata from there. Afterwards, you would upload your PDF with obtained metadata directly to Imaging.
    I also think that Import Server does not convert file format, but rather takes the file and adds in to a batch (for indexing/committing), so on condition that it can grab PDFs, you should be good to go with Import Server as such - it's been a while since I've done something with Import Server, so I'm not sure of all details. If you have an environment up and running, it should be easy to verify. Either way, Import and Scan are the only options to get inputs into batches, so if Import does not work for you, you can't use Capture anyway.
    I hope that helps, Jiri

  • HT2506 I'm using Preview with a MacBook Pro and MacOS 10.6.8. When adjusting sharpness in the Adjust Colour tool, images are not saved. Any hint? Thanks.

    I'm using Preview with a MacBook Pro and MacOS 10.6.8. When adjusting sharpness in the Adjust Colour tool, images are not saved. Any hint? Thanks.

    I too experienced the same issue.  Here are my details:
    Recently I bought a 15” Macbook Pro and last night I tried to connect and use a Edirol FA/66 Firewire 400 connected outboard audio interface using a Firewire 400 to 800 adapter then connected to a Firewire 800 to Thunderbolt adapter since the MBP doesn’t have a native Firewire port.  What I observed is that the Edirol was not getting power from the bus nor did the MBP (running Yosemite) recognize the Edriol.  At first I thought there was a problem with the Edirol since I haven’t used it in a while but when I connected it to an older MBP that has a native Firewire port, it worked normally.  Is there a known issue with these sorts of external audio interfaces working properly with newer MBP running Yosemite?  I’m hoping that a software update will fix this issue.

  • I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be

    I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be selected. Any thoughts? TIA

    Greyed imaged in the Import dialog box mean you have already imported the photos into Lightroom, so there is no need and no benefit to importing them a second time.
    Just go to the Library module, search for the desired photos, and resume working on these photos.

  • In the process of reformatting my macbook pro, I saved everything but my keyword list.  The keywords are with the images, but the total list I use under "Keywords" is not present.  Is there a way to re-create all my keywords I've used over the last 6 year

    In the process of reformatting my macbook pro, I saved everything but my keyword list.  The keywords are with the images, but the total list I use under "Keywords" is not present.  Is there a way to re-create all my keywords I've used over the last 6 years.

    I accomplished what I needed last night.  I remembered I had picked my favorite images from each year and put them in a "favorite" folder by year.  These folders included 500 to 1200 images per year.  I pulled up the folder for each year and highlighted all images and clicked on "Keywords" and all keywords used for all images were listed.  I made those keywords persistent.  It took me a while to realize I had to click on each keyword to make it persistent.  After doing this for all years, I assume 95% of all keywords I have used over the many years were back in my list.  I'm sure there is probably a more "technical" way to accomplish what I needed, but this seems to have worked.  I also exported my list into a word document and is saved on my hard drive.
    If I had not made folders with my favorite images for each year, I could not have used this method, so if you figure out a better way, I like to hear it.  Thanks for your comments and willingness to help.

  • HT1948 USB drive with install image is showing in Startup Manager on a Mac Pro, but wont boot. Showing circle with cross strip, and shut down automatically. USB device are made and work on two different MacBook Pro, but used on Mac Pro. Any help?

    USB drive with install image is showing in Startup Manager on a Mac Pro, but wont boot. Showing circle with cross strip, and shut down automatically. USB device are made and work on two different MacBook Pro, but used on Mac Pro. Any help?

    OS X installers have always been fairly specific, hardware-wise. I haven't read anything reflecting that situation with the Recovery HD, so it may be that the Recovery HD created for the MacBook Pro does not have the necessary drivers for the Mac Pro. Obviously, nothing definitive here, but a possibility.

  • How can I use wget, cron and Automator to periodically pull a dynamic image from a URL to local storage, and then update a Keynote slide with that image, automatically?

    How can I use wget, cron and Automator to periodically pull an image from a URL (which is dynamically updated - like a weather map, say - to local storage, and then update a Keynote slide with that image, automatically?

    Any particular reason for those specific technologies?  wget does not exist on a mac, although you can nstall it I guess.  OS X has curl installed which should do pretty much anything you want to do with wget.  cron is being replaced by launchd, although cron still exists on mountain lion.
    As far as I can tell from automator all the standard 'actions' to access keynote  available to it require keynote to be open and running, but does not provide a function to actually open it.  So I think you will have to write some applescript, as a minimum to open and quit keynote. I notice that the keynote actions are mostly circa 2005 an wonder if they would even work.
    Under utilities in automator 'actions' there is a capability to add applescripts as part of the workflow.
    Also, note that cron is being dprecated by Apple and replaced by launchd.  that said cron is stil on my mountain lion instalation.
    This entry at stackoverflow shows use of cron with curl to get web urls.  http://stackoverflow.com/questions/1683620/getting-started-with-cronjobs-on-a-ma c
    If I have any time I may try and get this to work as it is quite interesting and new to me.  But otherwise, good luck.

  • When rotating my custom .bmp image with Rotate Image Control.vi using the Rotate.llb, why is my rotated image coming up blank?

    I downloaded the Rotate.llb and am trying to rotate a simple 24bit .bmp I made in Windows Paint, but the rotated image comes up blank.
    I edited the default image control and indicator to have my image inside it and really don't know what else to do? The example works fine with the default image, I'm wondering if it has to do with my image properties?
    I tried using "Picture to Pixmap" but to no avail. Any help would be greatly appreciated. I am attaching a screen shot of my results and the modified Rotate vi I am working on, thanks.
    Attachments:
    Rotate Picture Control_v2.vi ‏16 KB
    rotate_shot.jpg ‏383 KB

    Hello Sametron,
    Give this a try:
    Regards,
    Jeff L.
    Applications Engineer | National Instruments
    Attachments:
    201606.zip ‏1 KB

Maybe you are looking for