Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Window containing JPG image does not draw correctly.(window is just redrawn repeatedly , moving down until it disappears. works OK in Win 7)
Window containing JPG image does not draw correctly. [message #1146151] Sun, 20 October 2013 01:45 Go to next message
Robert Adamson is currently offline Robert AdamsonFriend
Messages: 9
Registered: March 2013
Junior Member
I have a Java program that loads a .JPG file as an Image then displays it.
The very same code works fine on Windows 7 (same version of Eclipse/SWT), but on Linux, what you see is just a flickering outline of the window being drawn repeatedly - you never see the image. And each time it is redrawn the window outline move closer to the bottom of the screen until it disappears. I've tested the JPG file and it opens normally in Image Viewer.

This is ocurring on Ubuntu 12.04, Eclipse 3.7.2/SWT 3.7.2.
One thing that is confusing me, according to dpkg command there appear to be two versions GTK:

||/ Name Version Description
+++-============================-============================-========================================================================
ii libgtk-3-0 3.4.2-0ubuntu0.5 GTK+ graphical user interface library
ii libgtk2.0-0 2.24.10-0ubuntu6 GTK+ graphical user interface library

Now per SWT FAQ:
Q: Which GTK version do I need to run SWT?
A: SWT requires the following GTK+ versions (or newer) to be installed:

Eclipse/SWT 3.8.x and newer: GTK+ 2.6.0 and its dependencies
Eclipse/SWT 3.6.x - 3.7.x: GTK+ 2.4.1 and its dependencies <-------------
Eclipse/SWT 3.0.x - 3.5.x: GTK+ 2.2.1 and its dependencies
Eclipse/SWT 2.1.x: GTK+ 2.0.6 and its dependencies


So my v2.0 GTK is too low, but the v3.0 GTK should allow SWT to work correctly, in theory.
Is there anything I need to do to point Eclipse/SWT at the correct version of GTK?

OR is this issue being caused by something completely different?
Re: Window containing JPG image does not draw correctly. [message #1181512 is a reply to message #1146151] Mon, 11 November 2013 16:54 Go to previous messageGo to next message
Robert Adamson is currently offline Robert AdamsonFriend
Messages: 9
Registered: March 2013
Junior Member
I updated Eclipse to Juno SR2 and that did not resolve the issue.
(I assume that Juno is using an even newer version of SWT).
Re: Window containing JPG image does not draw correctly. [message #1205360 is a reply to message #1181512] Sat, 23 November 2013 15:23 Go to previous messageGo to next message
Robert Adamson is currently offline Robert AdamsonFriend
Messages: 9
Registered: March 2013
Junior Member
It's definitely somethiing with either SWT or the graphics package.
I tested with Snippet 48 - whch draws an image on a Canvas as my code does - and it fails with the same symptoms.
Re: Window containing JPG image does not draw correctly. [message #1205361 is a reply to message #1205360] Sat, 23 November 2013 15:26 Go to previous messageGo to next message
Robert Adamson is currently offline Robert AdamsonFriend
Messages: 9
Registered: March 2013
Junior Member
Oh crud! I tried again with a .JPG from another source (Astronomy picture from wired news) and it draws just fine.
So maybe my JPG files have an issue.
However, the JPG file that my code is trying to load can be laoded with both the Image Viewer application and Gimp without an issue.
The JPG file was created by an HP 4500 office jet printer/scanner.
The id in the JPG file is: HP oj_g510g-m
I Will keep digging.

[Updated on: Sat, 23 November 2013 16:27]

Report message to a moderator

Re: Window containing JPG image does not draw correctly. [message #1206340 is a reply to message #1205361] Sun, 24 November 2013 02:48 Go to previous message
Robert Adamson is currently offline Robert AdamsonFriend
Messages: 9
Registered: March 2013
Junior Member
Crying or Very Sad I finally got a clue and rescanned one of the images I want to display from the Ubuntu PC and of course, it displays just fine.
And as you may have guessed, all of the images that did not work, had been previously scanned from a Windows Vista or Windows 7 PC.
Go Figure. One would think that a JPG was always a JPG.

So this issues IS SOLVED, whether I like the answer or not. Smile
[ in case I can't figure out how to mark the entire topic as solved.]
Previous Topic:org.eclipse.swt.internal.win32.OS
Next Topic:OS X Mavericks: Vertical Scale renders wrong
Goto Forum:
  


Current Time: Fri Mar 29 02:12:05 GMT 2024

Powered by FUDForum. Page generated in 0.03797 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top