[VB6] Image Recovery from Project Files-VBForums
Results 1 to 5 of 5

Thread: [VB6] Image Recovery from Project Files

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    16,740

    [VB6] Image Recovery from Project Files

    Not a groundbreaking project by any means. This little project can retrieve images saved within an uncompiled resource file or within project binary files (frx, ctx, dsx, dox, pgx).

    Resource files. How to retrieve using just VB functions...
    1) BMP: LoadResPicture & SavePicture will retrieve & save in bitmap format
    2) ICO: LoadResPicture & SavePicture will only save the extracted icon. If icon contains multiple images, the others will be lost
    -- LoadResData for icons generates error.
    3) CUR: Same as icons, but worse: changes format from cursor to icon
    -- LoadResData for cursors, only bitmap data returned, not cursor header
    4) CUSTOM section. Use LoadResData then save returned array to disk.

    If the project is compiled, then any good resource hacker (badly named), can use APIs to locate the desired resource item, from the .exe/ocx file, & extract it in its entirety.

    If you have the binary files and the actual associated non-binary file to go with it, then...
    1) BMP. Note: JPG & GIF images in these binary files maintain their original image format
    a. In code, use SavePicture ControlName.Picture
    b. In design mode, click on control that has the bitmap image assigned. Find Picture in the property sheet & double click on it. Press Ctrl+C & paste into Paint & then save
    2) ICO/CUR. Cannot get the image, VB will not copy them to the clipboard
    in code, use SavePicture ControlName.Picture. But same restrictions apply as with LoadResPicture mentioned above for resource files
    3) WMF/EMF. In code, use SavePicture ControlName.Picture
    -- Should be able to copy to clipboard similar to bitmaps

    But if you want a solution that isn't limited to noted restrictions above. This project is one.

    Maybe there are other methods out & about. But honestly, not many people will find this useful until they have a corrupted frm file & their only copies of the images were in the frx file which may not be usable to VB any longer, but usable to this project if that frx itself isn't corrupted.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by LaVolpe; Oct 20th, 2014 at 08:24 PM. Reason: updated text
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  2. #2
    New Member
    Join Date
    Aug 2013
    Posts
    3

    Re: [VB6] Image Recovery from Project Files

    Many Thanks for posting

    Really useful - saved me a lot of time - Appreciated

    Jon

  3. #3

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    16,740

    Re: [VB6] Image Recovery from Project Files

    Jon, you're welcome. If you read this again, mind posting how you used this? What scenario happened that led you here to begin with? Just curious
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4
    New Member
    Join Date
    Aug 2013
    Posts
    3

    Re: [VB6] Image Recovery from Project Files

    Quote Originally Posted by LaVolpe View Post
    Jon, you're welcome. If you read this again, mind posting how you used this? What scenario happened that led you here to begin with? Just curious
    We supply a program EyeCap and Kapture which was originally written in VB5 and later VB6 about 15 years ago. The core of it is still VB6 but the enhancements have been written in VB.Net and PowerBasic. I have been associated with the product since its beginning but it has seen quite a few programmers working on it and about 3 company buy outs / change of ownership. I am now the only one left working on the support and development of the product. I was adding a new form and wanted to use some of the images used on the buttons from another form. But somewhere along the line the images where not put into Sourcesafe. At least somewhere along the line they have not been transferred from an old machine to a new machine. As the tape backup was not moved with the last buyout, it would be very difficult to restore the old backups and find the original images - hence the use of your program which saved me the time of reconstituting the images for the new form. Many Thanks

    Jon

  5. #5
    Addicted Member
    Join Date
    May 2011
    Posts
    198

    Re: [VB6] Image Recovery from Project Files

    Quote Originally Posted by LaVolpe View Post
    Jon, you're welcome. If you read this again, mind posting how you used this? What scenario happened that led you here to begin with? Just curious

    Hi Lavolpe!

    I searched this for YEARS! I just followed a recent post from you that lead to another project and in that other thread you mentionned THIS project.
    long story short, I was lucky enough to find this...

    so as for me... how am I using this...

    long time ago when I was designing project, I didn't put my files in a "ressources" directory... then someday, when I needed image I put on form, I couldn't retrieve the original...

    your project will help me with theses old picture long lost

    Thanks a lot!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.