Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011
    Location
    Pretoria, South Africa
    Posts
    27
    Blog Entries
    3
    Rep Power
    0

    Default Retrieve File Thumbnail

    I'm trying to get the thumbnail of a Directory, whether it is a file or a folder.

    I have this code and works 100%
    Java Code:
    ImageIcon img=(ImageIcon)FileSystemView.getFileSystemView().getSystemIcon(new File(fileName));
    only problem is it retrieves a 16X16 icon and when I need to draw this image on a bigger scale its all pixelated and look like the the 60's....

    so i was just wondering if there is a better way of retrieving the icon of a file and that's a bit bigger than 16X16

    Last edited by DuvanSlabbert; 10-10-2011 at 04:52 PM.

  2. #2
    Join Date
    Aug 2011
    Location
    Pretoria, South Africa
    Posts
    27
    Blog Entries
    3
    Rep Power
    0

    Default Re: Retrieve File Thumbnail

    ok, been searching high and low... even try to search for extracting icon from file in java and it seems like this is a dead subject... like not allot of ppl have tried this and seems to get it in working order.... so now I think the next question would be, how does the FileSystemView even get the file icon that is 16X16, maybe if we can figure that out we would be able to improve on that to get a bigger icon...

  3. #3
    Join Date
    Aug 2011
    Location
    Pretoria, South Africa
    Posts
    27
    Blog Entries
    3
    Rep Power
    0

    Default Re: Retrieve File Thumbnail

    I have been battling with this subject and reading up on allot of stuff... seems like its just not possible yet with Java.

    so for now my answer would be to stay at

    Java Code:
    Image icn=((ImageIcon)FileSystemView.getFileSystemView().getSystemIcon(new File(fileName))).getImage();
    						 icn = icn.getScaledInstance(32,32,Image.SCALE_SMOOTH);
    If you guys can get a better way on this matter, please let me know.

Similar Threads

  1. thumbnail display timing
    By gatensbury in forum AWT / Swing
    Replies: 14
    Last Post: 07-30-2011, 12:44 AM
  2. Retrieve file
    By mine0926 in forum NetBeans
    Replies: 2
    Last Post: 06-03-2011, 04:47 AM
  3. retrieve OS architecture
    By jitheshmenon in forum Advanced Java
    Replies: 4
    Last Post: 08-21-2010, 06:52 PM
  4. retrieve file containg image from database
    By rajeshwari_ib in forum Advanced Java
    Replies: 5
    Last Post: 12-15-2009, 09:10 AM
  5. Replies: 3
    Last Post: 11-10-2009, 10:24 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
  •