Results 1 to 2 of 2
  1. #1
    jiapei100 is offline Member
    Join Date
    Aug 2009
    Richmond, Canada
    Rep Power

    Default how to effectively use SWT ImageLoader??

    Hi, all:

    I've got a very interesting question to ask here.
    The code looks like the following:

    1) loading
    Java Code:
    String filename ="loaded.jpg";
    ImageLoader loader = new ImageLoader();
    ImageData imagedata0 = loader.load(filename)[0];
    2) saving directly
    Java Code:
    ImageLoader imageLoader = new ImageLoader(); 		= new ImageData[] {imagedata0};"saved.jpg",SWT.IMAGE_JPEG);
    The directly saved image (without any image processing) after loading
    is not the same as the loaded image.
    Please pay attention to the boundary of both faces.

    Can anybody help to explain this?
    Does that mean, the loading process and the saving process
    of SWT ImageLoader are not reversible?
    The loaded image is:

    The saved image is:

    Or, SWT may load various types of .jpg files,
    but may only save into a specific type of .jpg file?
    Anyway, can anybody help to explain this?

    Best Regards
    Last edited by jiapei100; 09-26-2010 at 04:10 PM.
    Welcome to Vision Open

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    It could be something to do with the compression that goes on with jpeg images. You can lose some details every time you write out a new jpeg. Try using another image format and see if it changes.

Similar Threads

  1. How to parse String effectively based on a dilimiter
    By raghu408 in forum Advanced Java
    Replies: 26
    Last Post: 04-10-2008, 11:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts