Results 1 to 5 of 5

Thread: Displaying icon of picture file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    North Texas
    Posts
    70

    Displaying icon of picture file

    I would like to display the icon of a picture file in a split panel, where each panel split contains a preview of what the picture file contains, much like you would see in the Windows Explorer folder of picture files set to display icons. I have tried using a picturebox loaded with the associated picture, and that works, but seems to be very sluggish and memory intensive. Got to be a better way!

    Is there a way to embed Windows Explorer within a panel?

    Thanks,
    David
    Thanks,
    David

    How much deeper would the ocean be if sponges didn't grow there?

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Displaying icon of picture file

    How are you loading the picture in the picturebox? Are you creating a bitmap and setting the image that way, or are you setting the picturebox's picturelocation? Because either way should take to terribly long.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    North Texas
    Posts
    70

    Re: Displaying icon of picture file

    Yes, at this point, I am setting the picturelocation of the picturebox. I have created a control that contains a picturebox and a label to hold the filename. When I select a folder, I find all the image files, add the usercontrol to the form and then populate the usercontrol with the picture file info. This sounds reasonable to me, but takes a long time and very sluggish when scrolling the form.

    I was thinking it might be better to use something like the datagridview but I am not familiar with it either. Any ideas?
    Thanks,
    David

    How much deeper would the ocean be if sponges didn't grow there?

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Displaying icon of picture file

    When you say sluggish, do you mean that it flickers alot and takes a while to scroll? If so, then try setting the form's doublebuffer to true. I think that will help out tremendously. Btw, my name's David too!!!

    -Edit-
    Also if all you want to do is store the file's image location without having to use a lable, you could set the tag property to the file location. That's if you don't really want the label.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Displaying icon of picture file

    Oh. If only there was a VB control that did exactly what the file panel in Explorer does and had its own list of images (small or large) you could add to and would display in different modes like Large Icon or SmallIcon or Tile. I wonder what you'd call a mystical control like that? It would be like a viewer but with listing capabilities. ViewList, perhaps?

    No, you're right, far too clever for the guys at MS ever to have though of. Shame though. Just think what you could do with one of those!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

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



Click Here to Expand Forum to Full Width