2 Attachment(s)
[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.
Re: [VB6] Image Recovery from Project Files
Many Thanks for posting
Really useful - saved me a lot of time - Appreciated
Jon
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
Re: [VB6] Image Recovery from Project Files
Quote:
Originally Posted by
LaVolpe
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
Re: [VB6] Image Recovery from Project Files
Quote:
Originally Posted by
LaVolpe
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!
Re: [VB6] Image Recovery from Project Files
I wonder if anyone can help with the app LaVolpe made above. i am trying to find out how i can add the Custom field to the list in a Resource and get back info.
ie origonal filename, file extension etc. if possible.
I have res files with data in and i can see the names i gave them , but wanted to see if there is an easy way i can modify this app
to give me an option to open a file based on file extension when it was added to the resource or something like that.
can anyone advise
Also another idea is to create my own container external to my finished app and use that to get images etc from. Is this a good idea
or are there some pitfalls. I would make my own *.dat file that poss contains , content name ie ( the name i would use to import file/image) , origonal filename, extensions etc.
then poss make another app to edit my external file. ie add or remove files or edit whats already there. pls advise
Re: [VB6] Image Recovery from Project Files