Strange pb with image

With this code :
boardImage = createImage(view.width, view.height);
try {
BufferedImage bi = ImageIO.read(new File(boardImg));
boardGraph = boardImage.getGraphics();
boardGraph.drawImage(bi, 0, 0, null);
I've got sometimes a blank image, I stop my prg and launch it again and all is good.
Any idea ?
I use jdk 1.6 (u3)
Edited by: clechenne on Nov 28, 2007 1:22 PM

With this example, I can see my image a few secs :-(
public class Gui extends JPanel {
     private JPanel bv;
     private JFrame frame;
     /** For displaynig msg. */
     private JLabel hintBar = new JLabel(" ");
      * The <code>JPanel</code> containing the main display area.
     private JPanel panMain = new JPanel(new BorderLayout());
     public Gui() {
          super(new BorderLayout());
      * Lays out the frame by setting this Client object to take up the full
      * frame display area.
     private void layoutFrame() {
          frame.getContentPane().setLayout(new BorderLayout());
          frame.getContentPane().add(this, BorderLayout.CENTER);
          hintBar.setBorder(BorderFactory.createLoweredBevelBorder());
          hintBar.setForeground(Color.RED);
          frame.getContentPane().add(hintBar, BorderLayout.SOUTH);
          frame.validate();
     public void initialize() throws IOException {
          frame = new JFrame("Easy Pzc");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(800, 700);
          // frame.setPreferredSize(new Dimension(800, 700));
          frame.setBackground(SystemColor.menu);
          frame.setForeground(SystemColor.menuText);
          layoutFrame();
          bv = new JPanel();
          // Place the board viewer in a set of scrollbars.
          JScrollPane scroller = new JScrollPane(bv);
          scroller.setViewportBorder(BorderFactory.createLineBorder(Color.black));
          add(panMain, BorderLayout.CENTER);
          panMain.add(scroller, BorderLayout.CENTER);
          // now we can ask bv to draw itself
          panMain.revalidate();
          frame.setVisible(true);
          Image boardImage = createImage(300, 400);
          BufferedImage bi = ImageIO.read(new File(".\\data\\boards\\10_10.png"));
          Graphics boardGraph = boardImage.getGraphics();
          boardGraph.drawImage(bi, 0, 0, this);
          Graphics backGraph=bv.getGraphics();
          backGraph.drawImage(boardImage, 0, 0, this);
     public static void main(String s[]) {
          Gui gui = new Gui();
          try {
               gui.initialize();
          } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
}Edited by: clechenne on Nov 29, 2007 1:48 PM

Similar Messages

  • Strange behavior with images from iPhone

    I'm wondering if anyone else has seen this behavior or can replicate.
    Take some pictures using an iPhone 3Gs (can't tell if it happens with other models).
    Bring the images into iPhoto and then drag them out to regular folders.
    Choose Cmd/Ctrl-D to place.
    The image, which is in Portrait orientation, comes into CS5 strangely.
    The frame does not hug the correct orientation of the image. Instead it follows a landscape orientation as if the image was rotated 90 degrees.
    When you let go from dragging the frame, the image appears vertical within the lanscape frame.
    The only way to get the frame any way close to the vertical orientation is to hold the Shift key.
    I have also noticed that these images are added to a video editing program rotated into a landscape mode.

    There's no such thing as a vertical or horizontal image with iPhones or any phone that sports and accelerometer. It's just a tag they add to images that is inconsistently supported. All photos are landscape, just some are tagged to indicate they are portrait. It's like when I was growing up I always thought my dad was Superman only to later find out he was just a drunk wearing a cape.
    If you want to just pull the images directly off the phone or just a generally nice thing for your iPhone/Pod/Pad you can get PhoneDisk. Costs nothing and works great other than my minor user interface complaint that they take advantage of the menubar's menuextras area that is supposed to be Apple only and hardware only at that. Human Interface Guidelines aside, it is a really nice utility.
    http://www.macroplant.com/phonedisk/

  • Strange problem with image scaling when placed

    I'm currently running InDesign CS6 from the Creative Cloud, and it's version 8.0. I have a PC and am running Windows 8.
    I am experiencing a really odd problem when placing images, and it only recently (within the last two weeks perhaps?) has developed. I do ebook production for a publisher. I have an InDesign template (INDD file really, but "blank" and ready to be filled in, and as such I refer to it as a "template") that I use, and the cover for the book goes on the first page. The document is set to pixels as the ruler measurement, and the pages are 650 pixels wide by 800 pixels tall. The margins are all set at zero. The cover images are sent to me as JPEGs and always have the same size: 72dpi setting and 500 pixels wide by 750 pixels tall. This is chosen to be about the size of the full screen on most ereaders, or close enough to be so.
    So when working on a new book, I put my cursor in the blank line that is set up to take the cover as an inline image. I do control-D to place, select the file, and hit enter. This SHOULD place an image at that location that is 500 pixels wide and 750 pixels tall when looking at the InDesign page rulers. Instead, InDesign insists on placing this image at 50% scaling, so that it is only 250 pixels wide by 375 pixels tall. And in the link info panel, it shows the actual PPI as 72 and the effective PPI as 144. It does this no matter how many preference changes I try (including the ones under file handling and the import setting options).
    The strangest part is that if the file is just a tiny bit different than 500x750 @72dpi, then there is no problem. For example, if I open the JPEG in Photoshop and change the image settings to 500x750 @73dpi, then InDesign places it at 100% scale like I want. If I change the image to 499x749 @72dpi it also gets placed in InDesign at 100% scaling. I've tried this with various new INDD documents with settings in pixels, inches, or picas as the ruler amounts, and with different page or margin sizes (just in case the problem is with my template). I get the same result no matter what.
    It appears that InDesign somehow thinks that any image that is exactly 500x750 @72dpi should be scaled at 50% when placing it into an InDesign file. Has anyone else run across this? Is it a bug or something I'm doing wrong? I've been doing this exact procedure for over a year, first with CS5 and now CS6, and I've never had this happen until just recently. I suppose it COULD be an accidental change in settings or preferences. But if it is, I cannot figure out how to change it back.
    UPDATE: I installed the 8.0.1 update and it did not resolve the issue. I also tried more image options. It looks like this scaling to 50% upon placing ONLY happens when all three attributes match this: 500x750@72dpi. All of the following modifications to the exact same image placed in the exact same spot in the exact same document resolved the issue:
    501x750@72dpi
    499x750@72dpi
    500x751@72dpi
    500x749@72dpi
    500x750@71dpi
    500x750@73dpi
    But of course, I don't want to have to modify every cover image I'm sent in order to prevent this scaling issue.

    I just tried this and got the same results (CS6, 8.0.1, on WinXP SP3). One other tidbit: the same 500px × 750 px @ 72ppi image saved as TIFF instead of JPEG worked correctly (at least for me). I haven't tried any other image formats yet.
    This sounds like a good candidate for an official bug report: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    -Bill

  • Problem with image opened in Photoshop

    Hi all,
    I am having a strange problem with an image opened from Aperture in Photoshop. Though the image looks fine, something is amiss. Most notably when I try to use the shadow/highlight command in Photoshop, the image actually darkens (highlights are set to zero amount). If I export the image as a jpeg and open it in Photoshop, the s/h command works as expected. If I export as a .psd file and open it, the s/h command again darkens the image. Interestingly, the .psd file thumbnail shows orange with read streaks through it, but opens as it should. Corrupted .psd conversion maybe?
    Any thoughts or suggestions would be appreciated.
    Thanks,
    Steve

    Additional info:
    Same problem with a series of photos taken about the same time.
    Other photos work fine.
    I exported the original .nef file, opened it in camera raw/photoshop. Works fine.
    Corruption/bug in the .psd conversion looks more likely unless I'm missing something. . . .
    Help!!!

  • Trouble Printing PDF's scanned with Image Capture

    OK this is a strange problem.  I have Macbook Pro and a Lexmark E230 laser printer which prints everything out just fine in safari, word, pages, numbers - anything except PDF's that are specifially scanned with the Image Capture application.
    I printed four PDF's that were made from different sources, some just assembled JPEGs, one that was text printed from Pages, and another instruction manual randomly downloaded from the internet.  All printed fine.
    My wife and I scan a lot for our home business and any PDF that we have scanned using Image Capture prints only the first page, then hangs, and then the rest of the document does not print.  If I try to print the second or other pages manually, I get an error printed on the page saying :
    ERROR: limitcheck
    OFFENDING COMMAND: image
    STACK:
    And the image partially prints. 
    I am aware of all driver issues, have tried using old drivers, completely reset the print system using the OPTION and ( - ) key in the printer system prefs.  I have also used the most up to date drivers, nothing seems to change this.  I am also aware of a printers limitations as far as using images or PDFs with a lot of memory. 
    The thing that makes me confused is that this all seemed to work perfectly before (in Lion) and even during the inital stages of Mountain Lion.  At some point (this is on my wife's computer), I'm not sure when the issues started exactly, I was unable to print PDFs scanned with Image Capture properly.
    This used to work, now it doesn't.  Printer hasn't changed, types of documents haven't changed.  Any ideas?
    Thanks so much,
    Jim

    Welcome to Apple Discussions, bubblebanium!
    I have experienced your problem on several occasions and found the culprit to be a corrupt font. Try selecting everything in the document and changing it to a font that you are certain prints. If the problem persists, try copying everything and paste it into a new document. If your document is several pages, try printing one page to hone in on the problem.
    If the problem still persists, does your document have bullet items? If yes, and the bulleted items were created with the automatic bullet feature, then the problem may be the default font used for that feature (most likely the Symbol font).
    To change to a different font, go to the Format menu, select Bullets and Numbering. Click on the style of bullets your document uses and then click the Customize button. In the next window, click on the shape of bullet your document uses and then click the Font button below. A Font window appears in which you can then select a different font. Afterwards, if the document prints, then the default font is probably corrupt and you may want to replace it with a good copy.
    Hope this helps.

  • Replacing bullets with images

    Are there plans to add the option of replacing the bullets in a bulleted list with images, as you can do in Word? Our current workaround is to insert the image as a background image through the CSS with appropriate spacing, but this isn't very accurate.

    Hello Michael,
    Since the rendering of bullets is up to the browser, we don't have much control over that other than what the browser can provide. According to CSS, I believe the correct style to use would be "list-style-image," but it is not well-supported, and the ICE browser in OHJ does not currently support it.
    I am not sure what MS Word does, but when you save a Word file as HTML, it does all sorts of strange things to the HTML. For example, a quick test showed that saving a list (with custom bullets) as HTML created a series of P elements with things like <span style='font-family:Symbol'>^<span
    style='font:7.0pt "Times New Roman"'>       </span></span>
    You could do things like that, too, but it isn't good HTML.
    -Ben
    Oracle Help team

  • Strange problem with color measure in Mac.

    Hello, I am having a strange problem with color measure in Mac. For example i create a gradient in Photoshop from color 200 200 200 to color 240 240 240. When i measure the color of the gradient with the color measure tool of Photoshop or with the built in OS X color measure tool the measured color is from 200 199 197 to 240 240 238. I have measured the same gradient with Photoshop for PC and the values are OK (the same values that i create).
    I dont know what is the problem, but i belive that the colors that i create would be the same that i measure after creating them, and also the same values between Mac and PC. I will appreciate it a lot any help or information that you could give me that helps me to understand what is happening here.
    Thank you for your time
    Marcelo.

    Yep you got it, proof as monitor basicaly strips out any profiling and just delivers it straight.
    is there any way to make the OS X color measure tool to measure the original color values
    You mean the document colors - No, like I said photoshop is filtering your image through document profile, proof setup and monitor profile. Why do you want to use Digital color meter anyway for this?
    i dont understand what is the point to measure color values that will change every time a calibrate my monitor.
    Because color values are 'bigger' than whats on your monitor. Your monitor (via photoshop) is only doing the best it can to display those values - which can be anything from LAB colors outside the gamut of your monitor - to CMYK colors. Calibrating it is the only way to allow your monitor to do this in any way accurately. (not ever really possible) Monitors have a certain gamut and are only dispays/representations of the REAL colors that a document, with a profile, holds. So there's only one good reason to measure monitor values, and that's to generate a monitor profile.

  • Strange Problem with Mail & Address Book

    Hi,
    I'm having a strange problem with Mail & Address Book.
    When I go to compose a new message from Mail and hit the Address button (to show my email addresses), it won't launch the contacts window!
    I get this log from console;
    2007-10-15 22:55:59.079 Mail[410] * -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
    If I try to launch the Address Book from my Applications folder, it won't open, and it gives me this log from console;
    2007-10-15 22:57:57.348 Address Book[417] * -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
    Oct 15 22:57:57 PB-G4 /Applications/Address Book.app/Contents/MacOS/Address Book: CGImageSourceCreateWithData data parameter is nil\n
    2007-10-15 22:57:57.350 Address Book[417] Don't know about packed image EditLeftCapStd
    2007-10-15 22:57:57.350 Address Book[417] Exception raised during posting of notification. Ignored. exception: * -[NSCFArray addObject:]: attempt to insert nil
    If I quit Address Book, i'll get this from console;
    2007-10-15 22:58:37.892 Address Book[417] -[ABAddressBook setDefaultCountryCode:] called with a unknown country code 'us'
    I tried deleting the preferences, re-installing Address Book, also tried creating a new user, again no luck!
    Can somebody help!!!
    Please?!

    Hi dp13.
    Do you have any Address Book plug-ins or system utilities that could interfere with Address Book? In the Finder, go to each of the following folders (if they exist). What do you see there?
    /Library/Address Book Plug-Ins/
    ~/Library/Address Book Plug-Ins/
    To make accurately reporting this information easier, you may open /Applications/Utilities/Terminal, type the following command (you can just copy it here and paste it in Terminal), and press <Return>. You can then copy the output of that command from Terminal and paste it in your reply to this post:
    ls -1 /Library/Address\ Book\ Plug-Ins ~/Library/Address\ Book\ Plug-Ins
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. You can easily locate any of the folders referred to in this post by copying the folder path here, doing Go > Go to Folder in the Finder, and pasting the folder path there.
    <hr>
    Did you also reinstall the appropriate Combo Update after reinstalling Address Book?
    Quit all the applications and verify/repair the startup disk (not just permissions), as described here:
    The Repair functions of Disk Utility: what's it all about?
    After having fixed all the filesystem issues, if any, reinstall the Combo Update for the type of computer and the version of Mac OS X you’re using, unless this is the version of Mac OS X that came with the computer:
    About the Mac OS X 10.4.10 Combo Update
    Mac OS X 10.4.10 Combo Update for PowerPC
    Mac OS X 10.4.10 Combo Update for Intel
    After installing the Combo Update, the computer may restart twice and the first restart may take several minutes. This is normal.
    Take a look at the following articles for guidelines on how to properly install system updates:
    Troubleshooting installation and software updates
    Installing software updates
    Basically, you should verify/repair the startup disk and back up before installing the update, no applications should be running while installing it, and you may experience unexpected results if you have third-party system software modifications (not normal applications) installed.

  • Strange problem with motherboard H67MA-E45(B3) =( please help

    Hi, I have a strange problem with my motherboard . I have a H67MA-E45 (B3) (MSI-7678) , when i try to update it ( http://www.pcbrain.it/images/stories/msi/H67MA-E45/bios/14.JPG ) , i choose the fourth option "Select one file to update bios" , but the bios did not recognize the update file (E7678IMS.1C0) into the Usb flash drive , but if i choose the second option (select one file to boot) the file is recognized. First I made a backup of the bios, and into the USB flash drive has been created a file called "E7678ICX.162" (my current update). Why the extension is IXC ?!? it should have been IMS ! . I tried changing the file extension "E7678IMS.1C0" (the new update) into "E7678ICX.1C0" and when i select the fourth option , the file is recognized! . Obviously I have not started the update , but if I proceed with the update, changed the name of the extension, is it safe? Or do damage?..please help me  :(
    P.S. Sorry for my bad bad and very poor english , i'm italian =)

    Quote from: HU16E on 28-September-11, 04:38:29
    Manufacturer's Website info;
    "KHX1333C9D3B1K2/4G 4GB 1333MHz
    (2 x 2GB)   CL9-9-9-27 1.5V"
    Still think there is a batch conflict or possibly a bad stick in the new sticks. Might test each new stick individually for a bad one. Again, the other solution for an 8BG kit may be the new Kingston HyperX PnP's. Could you post a screenshot of CPUID's CPU-Z Memory & SPD Tab for one of the new sticks?
    Added: Actually, screenshots of the old sticks Memory & SPD Tab may be of help too. It may be tRAS or tRFC differences between the two kits. Just speculation at this point though.
    All the batchs works perfectly...this is the screen http://imageshack.us/f/163/ramkk.jpg/ ...save and zoom
    EDIT: The old stick are SLOT #1 and SLOT #2 ...the new 3 and 4

  • CS3 strange order with LabelGraphics.jsx

    Hi all,
    I am experiencing a strange behavior with LabelGraphics.
    I can not figure how to make the script use a defined list in conjunction with a paragraph style to properly number the images from the beginning of the document downwards (or even continue across an InDesign book).
    Any ideas?
    Thanx in advance
    Michael

    to Olav,
    Thanx for letting me realise that it is not a problem from my side. I went on and tried the change you suggested and it worked as you predicted. It does not give consistent results. I gets all mixed up when I had more than 3 images on a page.
    to loic,
    I think that scripting is about cheating. You get to execute mountainous tasks with just one click. I can fully understand your way of thinking. I do not think I could reorder the paragraphs or relink the text frames since I work with long documents in autoflow (chapters of 50+ pages)
    The way I see it it would have to be one of two ways.
    Either 1. A topleft - bottomright approach, or
    2. A gravity like approach. This way the script would "hit" the highest on the page image going to the lower and so on.
    So could you please elaborate on your solution? And when I say elaborate I mean provide the copy/paste I would have to apply since I do not know scripting?
    It would be great if it worked.
    Thanx to both
    Michael

  • P43-Neo Strange behaviour with LG IDE/PATA DVD Burner attached

    Hello, I have spent several hours installing an OS on my new MSI P43 Neo-F v1.0 Bios v1.9:
    - 1x 1000 GB SATA HDD Seagate
    - 1x DVD Burner LG IDE/PATA HL-DT-ST_DVDRAM_GSA-H42N Firmware RL01
    - 4GB OCZ Gold
    - MSI RX2600 Graphic Card
    - Bequit! Power Supply 350 Watt
    Trying to boot from the DVD Drive works, but either XP not Vista could make it to the setup screen.
    - Vista stops after some seconds with an unexpected I/O error.
    - XP Setup just crashes and dumps register values.
    Boot from USB memory stick (DVD still attached but no DVD in) lets you enter the setup and select the HDD as intall target. But, if you click "next" it gives you a message that Vista could not verify if a suitable system disk is installed.
    I could only solve the problem by completely disconnecting the GSA-H42N DVD Burner from the IDE/PATA connector.
    I could install Vista now from USB.
    After Vista was installed I reconnected the GSA-H42N DVD Burner to the IDE/PATA connector and could install software etc.
    Anyone being able to comment on this very strange behaviour ?
    In conjunction with other boards I did not encounter issues like this with that LG DVD Burner.
    It has shown that with the MSI P43 Neo F the LG GSA-H42N is unable to boot any CD/DVD. Linux for example stops booting with image crc check error.
    I have now swapped the LG GSA-H42N with an GSA-H10N from my other machine and it can boot any CD/DVD from it - everything runs fine.
    The LG GSA-H42N now runs with my other machine (with an Asrock P43 DE motherboard) also without any problems it can boot any CD/DVD from it
    Thank you,
    CPU

    Please post your Full System Specs with PSU specs amps.
    >>Posting Guide<<

  • Relative path with images

    Hi All -
    I have a strange situation with relative paths. When I use a relative path in cfinclude it works. But when I use a relative path is "src" attribute of <img>, it does not work. Can anyone suggest why could this be happening?
    Thanks

    Adam Cameron. wrote:
    Because you're expectation is that apples work the same as oranges.
    CF relative paths are relative to the CF file the path is in; HTML relative paths are relative to the URL browsed to.
    Remember CF code is run on the CF server; HTML is rendered on the browser.
    Adam
    The beauty of relative pathing is that it plucks them from the tree and calls either fruit.

  • I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.  I've been unable to locate an app that will do this.

    I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.
    I've been unable to locate an app that will do this.  The Photos app that comes with the phone or iPad has extremely limited duration controls.  PhotoStream seems to load everything from my phone or iPad not allowing me to just load up a set group of images.
    iPhoto for iPad is getting some terrible recent reviews.  I tried a couple other free apps but they don't use Airplay.
    I can do something like this with iPhoto and my MB Air, but it's kind of ugly to have the computer open in order to connect by Airplay to my Apple TV.  I've thought the iPad or iPhone would be a lower profile controller.
    Am I out of luck?

    Thanks for your help.  Since I'm uninterested in loading all my photos (the only option) into photostream, I won't be able to use the settings in ATV.  I guess I'm just stuck with using iPhoto on my MB Air.  Thanks again.
    paul

  • WYSIWYG editor upload with images

    Hello, friends!
    I need help solving following problem:
    I need to create WYSIWYG editor, which just to enter text and image. Other options (like font-size, font-weight...) not need. Then when submit the form with richedit, all data in form with images must sent to server.
    1) images must upload
    2) text must content following: text <img="src=../image1.png"> text <img="src=../image2.png"> text
    or maybe all images must save as a blob data
    Help me, people!

    Is this an Oracle question?

  • Online banking site now shows login page as text-only; on different computer it still shows page with images and clickables -- is there a fix?

    Previously when I logged in to my INGdirect online bank account, the login window came up showing images and clickable hotspots. Recently, the login window changed to a text-only version. On two different computers running Firefox, the login comes up in the previous version, with images and clickable hotspots. I'm unaware of having done anything to change my settings either in Firefox or on the banking website. Because it seems to be localized on this computer, I've tried downloading latest version of Firefox, but got no change, login still comes up in text-only format.

    Try clearing your browser cache.
    Tools > Clear Recent History... - hit Details and make sure only Cache is selected, then select Everything and hit the Clear Now button.

Maybe you are looking for

  • [JS CS3] Tab Stops in Table

    Below is a function that would delete all existing tab stops in a column and the add a new tab stop. function TabStopper (myPosition, xx){ myTable.columns.item(xx).cells.everyItem().texts[0].tabStops.everyItem().remove(); myTable.columns.item(xx).cel

  • TWAIN with Java question

    I'm testing the Gnome 4.2 API and it works reasonable well, but, how can you tweak the parameters for better quality scans for b&w pages ? I need to capture contracts (not for OCR, just the best snapshot I can get for database storage) in b&w. I can

  • Ipw2200-fw error

    I am new to arch, but I have gotten a working arch installation with xfce (lxdm isnt working at the moment but that is a problem for another topic). However, on startup, the package ipw2200-fw returns an error (-2), so the wireless doesnt work immedi

  • Preview for developer cyan update

    Every one of friends are using preview for developer cyan update so i cant wait any more. So , if I update through developer na what are problem i will face. Am using 720 and i have additional warranty so that i have any problem in warranty because m

  • UWL Configuration Document for EP 7.0

    Dear all, We are on EP 7 and trying to configure the UWL. I have a few documentation on the configuration of UWL (not sure whether is works for EP 7). When i try to Registering System Item Types with the UWL, i can see the following option which is d