• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pasting Images Problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm having a problem pasting images from an external application to my java app. The external app uses the Windows clipboard to copy these proprietary images into a format that is not documented, but as I understand it, Windows uses BMP by default.

The problem is that when the clipboard contents are pasted into my application, the images are offset. Now, if I paste the clipboard contents into another application(Paint.net, Photoshop), this problem does not occur. If I save the pasted image from Photoshop to an 8 bit indexed BMP, reload that image, copy and paste, the problem occurs. If I save it from Photoshop to an 8 bit RGB BMP, reload the image, copy and paste, the problem disapears(no offset). If you don't have Photoshop, the problem can be replicated in the native Windows Paint program.

I've included a small program that demonstrates the problem, as well as two images. The correct.bmp image works fine, incorrect.bmp shows the problem. The are both quite large(1 ~ 5 mb).

Any help would be greatly appreciated.

correct.bmp incorrect.bmp

reply
    Bookmark Topic Watch Topic
  • New Topic