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.
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.