Canvas and BufferedImage display different.

I use the same method to paint the Canvas and the BufferedImage. But the Graphics2D drawString method
shows up correctly on the Canvas but not on the BufferedImage (JPEG). Why is there a difference?
I use the Graphics2D to rotate the text 90 degrees.
I can't think of any reason why the display comes out different.
Any suggestions???
Thanks.

Here is the code for putting the Canvas graphics onto the BufferedImage (JPEG).
public void save(HCanvas comp) {
     int w = comp.getWidth();
     int h = comp.getHeight();
     Frame frame = new Frame();
     BufferedImage im = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
     Graphics2D g2 = im.createGraphics();
     g2.setPaint(Color.white);
     g2.fillRect(0,0,w,h);
     g2.setPaint(Color.black);          // back to default color
     comp.paint(g2);                              // Graphics argument
     g2.dispose();
     FileDialog fd = new FileDialog(frame,"Save As JPEG",FileDialog.SAVE);
     fd.show();
     try {
          String dum;
          dum = fd.getDirectory() + fd.getFile();
          OutputStream out = new FileOutputStream(dum);
          JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
          encoder.encode(im);
          out.flush();
          out.close();
          im.flush();
     } catch (Exception FileNotFoundException) {
          String errormsg = "File Not Assigned";
          JOptionPane.showMessageDialog(frame, errormsg);

Similar Messages

  • Canvas and BufferedImage display drawString differently.

    I use the same method to paint the Canvas and the BufferedImage. But the Graphics2D drawString method
    shows up correctly on the Canvas but not on the BufferedImage (JPEG). Why is there a difference?
    I use the Graphics2D to rotate the text 90 degrees.
    I can't think of any reason why the display comes out different.
    Any suggestions???
    Thanks.

    Here is the code for putting the Canvas graphics onto the BufferedImage (JPEG).
    public void save(HCanvas comp) {
    int w = comp.getWidth();
    int h = comp.getHeight();
    Frame frame = new Frame();
    BufferedImage im = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = im.createGraphics();
    g2.setPaint(Color.white);
    g2.fillRect(0,0,w,h);
    g2.setPaint(Color.black); // back to default color
    comp.paint(g2); // Graphics argument
    g2.dispose();
    FileDialog fd = new FileDialog(frame,"Save As JPEG",FileDialog.SAVE);
    fd.show();
    try {
    String dum;
    dum = fd.getDirectory() + fd.getFile();
    OutputStream out = new FileOutputStream(dum);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(im);
    out.flush();
    out.close();
    im.flush();
    } catch (Exception FileNotFoundException) {
    String errormsg = "File Not Assigned";
    JOptionPane.showMessageDialog(frame, errormsg);

  • Lllustrator and Photoshop display different colors despite synchronized CS5 Color Settings

    I've got some students who noticed that Illustrator and Photoshop display completely different colors on screen for eactly the same RGB values despite Color Settings being synchronized.
    Settings are:
    CSF: North American Web/Internet  (RGB color space = sRGB),
    Proof Set-up: Internet Standard sRGB
    Proof Colors turned On.
    RGB Values:  R=0  G= 162  B=211
    But colors displayed are not close between Ai and Ps.
    With Proof Colors turned off, both apps display the colors reasonably closely.
    I teach Photoshop and Print Color Management, so I admit my knowledge of how Illustrator handles screen proofing and proof set-ups for screen destinations is not comprehensive.
    I expect I'm missing some difference in the two apps' behaviour.
    Any info from anyone experienced in this corner of the field appreciated.
    Cheers
    Tom

    I've got some students who noticed that Illustrator and Photoshop display completely different colors on screen for eactly the same RGB values despite Color Settings being synchronized.
    Settings are:
    CSF: North American Web/Internet  (RGB color space = sRGB),
    Proof Set-up: Internet Standard sRGB
    Proof Colors turned On.
    RGB Values:  R=0  G= 162  B=211
    But colors displayed are not close between Ai and Ps.
    With Proof Colors turned off, both apps display the colors reasonably closely.
    I teach Photoshop and Print Color Management, so I admit my knowledge of how Illustrator handles screen proofing and proof set-ups for screen destinations is not comprehensive.
    I expect I'm missing some difference in the two apps' behaviour.
    Any info from anyone experienced in this corner of the field appreciated.
    Cheers
    Tom

  • Sideways and Vertical displays different for the same song

    When I play music on my iPod touch 4th generation, the name of the song appears normally in the vertical position, but the first word is omitted in the sideways display. ("Awake And Alive" displays as "And Alive" when sideways.) How can I fix this?

    Hello Beverly,
    Thank you for the question.  I would be concerned too if I received two emails for the same purchase. 
    I suggest checking your purchase history in the iTunes Store to see if there are two separate charges listed for this song.  Use the steps in the following article to check your purchase history in the iTunes Store:
    iTunes Store: See your purchase history and web order numbers
    http://support.apple.com/kb/HT2727
    If you do in fact see two separate charges for the same song, you can report the issue to the iTunes Store using these steps:
    To report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase, follow these steps:
    Find the email receipt for your purchase.
    Click Report a Problem under the app that is having the issue.
    When prompted, enter the Apple ID and password you used to purchase the item, then click Report a Problem.
    Click Report a Problem next to the item you are having an issue with.
    From the Choose Problem dropdown menu, choose the appropriate issue.
    Follow the onscreen instructions and—if prompted—type a description of the problem into the text field.
    Click Submit to have your issue reviewed.
    Find the full article here:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
    http://support.apple.com/kb/ht1933
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Song and Artist display differently in landscape mode (iPod on iPhone)

    I have a CD Compilation *50 Best Songs Ever*. When I play any song from this Compilation on my iPhone, if I turn the phone to landscape mode the Artist defaults back to the Artist on the 1st track, but if I turn the phone back to upright mode the Artist shows correctly.
    This is a CD Compilation of various artists, and the only one it seems to happen to.
    Any thoughts?
    brenodo
    iPhone 1.1.2 (3B34b)

    No, the OP is correct, there is some sort of funky bug here. I have noticed it too. To the extent that it is almost comical. In portrait view the song/artist/album artist/album art are all correct; then switch to landscape view and you get a comical mix of songs from different artists, wrong album art (from first one in list) and the name of the song and artist are wrong, and inconsistent with what is playing. Rotate back to portrait view and all is good again.
    It is at best a minor inconvenience, and I love my shuffle anyhow, so the randomness of it is sort of fun/funny.
    But it is definitely a bug.
    Zac

  • Contrast / Gamma Different in Canvas and Desktop Preview

    *The Confusion:*
    The contrast of my video differs between the Canvas Window and Desktop Preview.
    I assume the two are using different gamma settings. But I can't figure out what's going on, to know what those settings are and how to assess the final display picture.
    *Screen Grabs:*
    Here's a screen grab of the canvas, with the image at 100%. The screen grab does not show the full frame.
    - - - http://epokhecutmedia.com/images/gamma-ts-canvas.png
    Here's a full screen grab of image in Desktop Preview.
    - - - http://epokhecutmedia.com/images/gamma-ts-preview.png
    *What I've done:*
    I've gone through every gamma setting I know of and can't match the Canvas and Desktop Preview or make sense of the difference.
    Also, If I toggle between Display calibrations of 1.8 and 2.2 using the Display preferences in System Preferences, values in both the Canvas and Desktop Preview shift and still do not match.
    *Another seemingly related thing:*
    My Canvas window display jumps between different contrasts (possibly gamma values) automatically while I'm working.
    For example,
    - - - I'll have video frozen. I'll play it and the image with brighten across the mids with playback. However, after freezing it again it keeps the brighter value.
    - - - When I'm using filter, such as the 3-Way Color Corrector, when I click to drag a slider, the image with darken across the mids. Sometimes, as I drag, the canvas will erratically jump back and forth between the two values.
    *Why this is a problem:*
    I can't do basic exposure correction, because I don't know which is the accurate value to work with.
    edit by: FordPrefectRevisited, Screen Grabs added

    If I may re-open this thread, let me ask the question FordPrefect only alluded to:
    Given that I should be using a pro-level HD broadcast monitor to view everything, given that every piece of footage is different in the particulars, and given that the Canvas Window image is almost always different than any other playback system (Finder, QT, VLC Players, etc.), are there general exposure/gamma changes y'all make to account for the visual difference between the Canvas Window and other playback systems? If you're anything like me, you don't start from SCRATCH on every single edit... You have a few go-to filters with a few go-to settings, and then make minor adjustments according to the needs of the footage.
    For instance, in order to get the exported image close in exposure to the ideal Canvas Window image, I usually go: Effects - Video Filters - Quicktime - Brightness and Contrast - and then adjust the Brightness to 0.85 and it seems to get close.
    You guys have anything like that? Thanks for any help!

  • Illustrator CS4 and my drop down menu displaying different typefaces is no longer displaying font preview.

    I am using Illustrator CS4 and my drop down menu displaying different typefaces is no longer showing all of them, just blank spaces where they would be...that is unless I put my cursor over it and I can then see the typeface. This is more of a nuisance than anything and didn't happen until I updates OS X to Yosemite. I currently am operating OS X  Yosemetie 10.10.2
    I have attached a screen shot. You can see that the font highlighted as the cursor is over it I can see the preview...but one I move the cursor it appears like all the others in the list and is blank.
    HELP!

    Solved using this previous users had the same issue; Font previews not appearing correctly in the character window after upgrading to Yosemite

  • I have a macbook pro, and i want to transfer my hard drive from my macbook, but the display drivers and such are different.  How do i do this?

    I have a macbook pro, and i want to transfer my hard drive from my macbook (500g), but the display drivers and such are different.  How do i do this and is it possible?
    The Macbook Pro has Mac OS X 10.4.11 (70g hard drive)
    The Macbook has Mac OS X 10.6.8 (500g hard drive)

    The MacBook's hard drive lacks the necessary hardware drivers to boot the MacBook Pro even though it has a much newer OS on it; that's why simply moving it into the Pro doesn't work. Presumably you have a very old MB Pro, because only the very first MB Pro model (produced January to May 2006) was ever offered with an 80GB hard drive. Are you sure you want to move your big drive into such an old machine? The MacBook must be newer, because the first MacBook was introduced just as the first Pro model was discontinued.

  • Canvas and viewer won't display video correctly

    I have just reinstalled and then reinstalled 5.1.4. Picture plays on external video monitor but will not play in either canvas or viewer. RGB is set. Mirror on playback is set. Audio will play. Viewer will play on external monitor. Usually a still will be on viewer of canvas screen or just a jumbled mess. Sometimes with parts of display frame included in mess. Thanks for any help.

    Thanks for posting helpful info re my problem. Issue finally resolved. FYI in case you should encounter a similar problem. I failed to mention in my post I was running two video displays. The video card I was running on when I developed the problem had been my auxilary display and was too underpowered to run the canvas and viewer. I inadvertaintly switched final cut pro to that card and monitor when my previous main monitor quit. I simultaneously had a drive boot problem. All is well that ends well, I suppose. Only took 4 days to sort it out and could find no info in tech manual that would have led me to this.

  • PDF file displays different number of text blocks in Acrobat Pro CC 2014 and CS6 versions

    Hi,
    I've inherited a file at work that displays different numbers of text blocks, depending on the version of Acrobat Pro used to view the file. Here's the specific issue:
    As viewed in CC 2014:
    "Chapter 1 - Chapter One Title": Appears as two text blocks -- one for "Chapter 1 - " and one for "Chapter One Title"
    As viewed in CS 6:
    "Chapter 1 - Chapter One Title": Appears as a single text block -- "Chapter 1 - Chapter One Title"
    This occurs only with regard to single-digit chapter numbers that are whole numbers. So:
    Chapter 1, Chapter 5, and Chapter 7 entries appear as two blocks in CC 2014, one block in CS6.
    Chapter 2.0, Chapter 6.1, Chapter 10, entries appear in single blocks in both CC 2014 and CS6.
    The PDF file was created -- I believe -- through the save-to-PDF feature in Word 2010.
    Any idea what's happening here?
    Thanks.
    David

    First of all, there is no such thing as Acrobat CS6 or Acrobat CC 2014. We assume you are referring to Acrobat X and Acrobat XI respectively.
    Secondly, how are you determining how many text blocks are in the PDF file? By use of the text touchup/edit function in Acrobat? If so, how this edit function displays text doesn't necessarily correspond to the actually underlying text fragments in the PDF file. In fact, sometimes it combines fragments based on heuristics. Those heuristics have varied with different version of Acrobat.
    PDF as a file format doesn't know the context of the graphical objects such as text. There is no concept of a line, a sentence, a paragraph, a column, etc. in terms of text. Runs of text are context-insensitive. You will get “breaks” when switching between regular and italics or when unusual paragraph justification is involved.
    Is the actual problem in trying to edit the text or something else?
    If you post a file, and indicate what text we should look at, we can confirm what is actually going on in your file.
              - Dov

  • I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I a

    I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I adjust it to look normal?

    Hi Paul ,
    It could be a compatibility issue as well as Acrobat 8 is an older version.
    Do you get any error message while registering for the product?
    Try repairing it and once and also check for updates as well.
    Is it happening with all the word files or any specific one'?
    Regards
    Sukrit Dhingra
    Acrobat 8 and Windows 7 Don't Work

  • Lightroom and photoshop display colours differently??

    I have just done a colour critical shoot of fashion garments. There is a dramatic difference particularly noticeable in Purple colours between Lightroom and Bridge. Lightroom displays it as blue and Bridge displays it correctly. I cannot figure out why this is - it means that I cannot work in Lightroom as I am not sure if the colour is correct or not.
    Please - if anyone can shed some light on this I will be eternally grateful.
    By the way I work on a mac with CS3 and the latest lightroom - on a calibrated system so it is not a calibration issue.
    Marc

    Are you sure that bridge is actually generating previews from the RAW and that you are not just looking at the camera-generated jpeg preview embedded in the RAW? This is pretty typical for bridge to do. The camera-generated preview generally looks very different color-wise from Lightroom and ACR because the camera manufacturer. Test this by double-clicking the RAW in bridge. Usually the color will be quite different from the preview you see in Bridge. After you close ACR, the preview will get updated in Bridge too. The reason behind this color difference is that camera manufacturers use secret, proprietary algorithms to determine the color from the camera's raw sensor data. This color is not necessarily correct, but what they consider "pleasing." If you shoot RAW, your RAW converter supplies its own interpretation of the data. Usually based on shooting color patches with the same camera.

  • Embedded fonts display differently in mx and spark

    Hi there,
    My apologies if this is an known issue but I have not been able to find any posts describing this problem. As the title of the discussion describes the problem I see is that when embedding the same font for spark and mx components they display differently to the point of making the application look sloppy. I created a small app to illustrate the problem:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
        minWidth="955" minHeight="600"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @font-face
    src:url("arial.ttf");
    fontFamily: arialCFF;
    embedAsCFF: true;
    @font-face {
    src:url("arial.ttf");
    fontFamily: arialNoCFF;
    embedAsCFF: false;
    advancedAntiAliasing: false;
    s|Label
    fontFamily: arialCFF;
    fontSize: 20px;
    mx|Label
    fontFamily: arialNoCFF;
    fontSize: 20px;
    </fx:Style>
        <s:layout>
            <s:VerticalLayout
                paddingLeft="10"
                paddingTop="10"/>
        </s:layout>
        <s:Label text="This is a label that uses spark"/>
        <mx:Label text="This is a label that uses mx"/>
    </s:Application>
    I used the Arial.ttf font I found in my mac, though I have also tried with courier new and even the myriad web pro provided with an example in the SDK. Also I have tried with SDKs 4.1, 4.5 and 4.5.1. I have played with the value of advancedAniAliasing as well. Regardless of the combination I will still see differences such as this:
    Is this a known issue? Any solutions at hand?
    Thanks in advance for the help!!

    Hi there,
    Thanks for the quick reply. I was able to make fonts display correctly after hacking the display of some components (mx.controls.FormItem for example) however I did notice a whole buch of runtime warnings that showed up as a result of the workaround such as:
    warning: incompatible embedded font 'arialCFFFont' specified for mx.core::UITextFormat. This component requires that the embedded font be declared with embedAsCFF=false.
    TextFieldAutomationHelper:captureSelection() - 'selectionBeginIndex' is not implemented in FTETextField.
    And in some cases for components I do not even use:
    warning: incompatible embedded font 'arialCFFFont' specified for mx.controls::TextInput (TextInput1967) . This component requires that the embedded font be declared with embedAsCFF=false.
    Any ideas on how to avoid this noise or do we have to live with this?

  • Image Displays Differently in PS and Br CS4

    I have a gs tif file that I converted to cmyk. In PS the cmyk version looks virtually identical on screen to the gs version although when you hold the eyedropper over the image, cyan displays as a higher percentage than m or y, with k lowest in both the cmyk conversion and the grayscale original...what do I have set wrong!  In Bridge the cmyk version clearly shows a cyan cast.
    Color settings are synchronized in CS4.
    Can anyone tell me why: 1, the images are displaying differently, and, 2. using Convert To Profile, cymk, Working CMYK US Sheetfed Coated v2, image appears to have a distince cyan cast? And why, for that matter, is the GS image showing uneven cmyk percentages?
    Thanks in advance
    J

    the images are displaying differently
    Have you proofing enabled in both of them? Even if the profiles match otehrwise, that option still has to be toggled.
    image appears to have a distince cyan cast?
    Well, if you print CMYK, you want "rich black", which means that it needs to be underprinted with another color to not look like a dull gray. Only spot black/ text black does not require that. That's not the point here, though. It's really due to the conversion being done wrong. If you really want to retain the blacks as a pure channel, use the method described. Also, if you can, in the future simply start out in CMYK to avoid these issues.
    Mylenium

  • Why my calendar display different there is one day difference from different  when I see main screen and open the calendar

    See my Why my calendar display different there is one day difference from different  when I see main screen and open the calendar

    I too am having the same issue only I am in Regina, Canada.  iCloud appears to think Regina, Canada is in the Central time zone which it is, but it does not use Daylight Savings time.  My PC is Windows 7 and I am using Outlook 2010.  I have iCloud on iPhone 5 and iPad 2.   Terribly frustrating!

Maybe you are looking for