PDA

Click to See Complete Forum and Search --> : [VB6] Picture/Video Viewer


MartinLiss
Jul 7th, 2008, 10:43 PM
Utility: Viewer/modifier for JPEG photographs and AVI and MPEG movies

Title: Picture Viewer

Description: Allows the user to view JPEG format photographs and AVI and MPG movies. It allows the JPEGs to be viewed in a variety of ways, to add descriptions to them, and to rotate, crop, print and delete them if desired.

Note: In order to run the Picture Viewer you will need to download the FreeImage.dll from here (http://freeimage.sourceforge.net/download.html) and place it in the App.Path since it's too big to attach, or PM me and I'll send you a copy.

Version 1.7 - 02/22/10:

Added picture print function
Add ability to change the size of of a movie while it is paused
Added scrolling thank you's to Vb Forums members in Help|About
Got rid of annoying beep heard when jumping to a specific image number
Improved the thumbnail display
Added sort by date Picture Created option
Moved Select parent Folder option to File menu
Corrected several minor bugs

Version 1.6 - 09/24/08:

Add picture names to thumbnails
Corrected bug involved in changing parent folder

Version 1.5 - 08/18/08:

Added the ability to view movies
Descriptive placeholder images now show up instead of "invalid picture" messages and in situations like the slideshow where a movie can't be shown.
Added code so that the name of the picture or video always shows up in the screen caption.
Corrected tab order of forms.

Version 1.4 - 08/03/08:

Implemented a much faster method of finding the pictures in a folder
Added Horizontal scrollbar for use with thumbnails, and changed the thumbnail exiting method to Esc to be consistent
Load cursors and variable icons from a resource file instead of hard drive
Added pause/resume feature in slideshow
Removed "Normal" and "Full Screen" radio buttons in favor of a ControlBox
Added more right-click popup menu items
Corrected major problem where the addition of a long description would damage a photo. Corrected by removing PlanetSourceCode code with functions from the FreeImage library. Tested successfully with 3000 character description.
Corrected a small bug where in rare instances a division by zero error could occur when creating a crop rectangle
Corrected a small bug where the display of long comments was being cut off
Corrected a small bug where in a long node list if the selected node required scrolling to get to then the selected node would go out of view after a slideshow
Corrected a small bug where treeview width was not restored after running slideshow from Expanded view
Corrected a small bug where when entering slideshow from full screen, the current photo wasn't resized

Version 1.3 - 07/25/08:

Added image cropping function
Added tooltips to main form
Corrected a problem where the same starting tooltip was always shown depending on how the tips were closed
Added more tips

Version 1.2 - 07/15/08:

Made several changes and corrections to zoom function including the prevention of the zoomed image from becoming too large, or smaller than the original size, implementation of Ctrl_R as a way to re-center the zoomed image, and the use of a "magnifying glass" cursor
Reduced picture flutter during resizing. (Thanks to Half Flung Pie)
Added "Comments to be Ignored" menu item and dialog so that a list of camera manufacturer's comments can be maintained.
Corrected problems the occurred when opening the app after the app had been closed in "Full Screen" mode
Made corrections and improvements to slideshow picture description processing
Added more tips

Version 1.1 - 07/12/08:

Made changes to accommodate 1024 x 768 and other resolutions
Replaced vbuSplitter2 (vbuSplitter2.ocx no longer needed) with code
Added right-click popup menu
Added progress bar when loading pictures
Added option to set the number of photos that will trigger the display of the progress bar while loading the pictures
Made a small change to the "Select the parent folder..." dialog
Added code to save form position
Corrected small bug where direction buttons had to be pressed twice after ending slideshow
Corrected thumbnail display processing so that the thumbnail always displays the whole picture
Made small correction for Apple cameras. At least one Apple camera was placing "AppleMark" in the description area of the photo and the change was to not show that text. It will be overridden by any description added by this app.
Added more tips

Version 1.0 - 07/07/08:

View photos one at a time or in a slide show
View photos in "normal" or full screen mode
Add a description to a photo. Note: the description is stored in the photo. I've never had a problem with this but test it first with a photo you don't care about.
View all the thumbnails at once for the photos in a folder
Zoom in or out on a photo
Rotate a photo
Send a photo to the recycle bin


Known Problems:

When a picture is rotated, the internal thumbnail is not kept in sync, in other words it is not rotated.
There may be some color distortion in the preview crop picture when one dimension is significantly larger than in the other. The distortions do not however show up in the final JPEG.


Screen-shots: See below

Author Name: Martin Liss

Thanks: See Help|About

76478

half flung pie
Jul 8th, 2008, 12:17 AM
MartinLiss, I believe we also need an OCX called vbusplitter2 and one called NumberBox. I'm assuming this "NumberBox.ocx" is the one linked to in your signature, but I don't know where to find vbusplitter2.

The screenshot looks promising though! :)

MartinLiss
Jul 8th, 2008, 12:31 AM
Yes it is, but I've attached it here in a zip file along with VBUSplitter2. I'm also going to update my original zip above so that it includes them.

half flung pie
Jul 9th, 2008, 01:55 PM
I'm not entirely sure why, but when I run Picture Viewer, I get only a screen with the directories and the picture. In other words, I have none of the buttons at the bottom of the screen. I'm wondering if this is a resolution issue, as I'm only running at 1024x768.

Another small thing I should point out: There is no indication to the user that the program is "loading...". When I click on "My Documents" or "My Pictures" there is a small amount of time when the program loads things from that directory. The program will appear to freeze for less than a second, and that is good. However, if I travel to a sub-directory in "My Pictures" called "Kodakz," Picture Viewer will appear to freeze for about a minute and a half while it processes 1.09GB (or 777 files) of images. All I'm proposing is placing a {"loading..." / "processing..." / whatever} image in the picDisplay before the processing happens.

Another thing I just noticed,
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

cmdExit_Click

End Sub
Does not seem to work. I can click "X" many times and nothing happens. However, if I go to File, Exit, the program shuts down quickly.

Otherwise, the program seems stable. If it didn't crash while going through my collection of pictures, I'm not sure it CAN crash. (I refuse to delete pictures)

MartinLiss
Jul 9th, 2008, 02:16 PM
I'll fix the resolution issue.

As for "loading" indication, don't you see an hourglass?

As for cmdExit_Click, that's a holderover from when the form had a ControlBox and I'll remove that line, but that begs the question - what "x" are you clicking since there's none on the form?

half flung pie
Jul 9th, 2008, 02:24 PM
There is indeed an hourglass, however since there are no "DoEvents", Picture Viewer appears frozen while processing large amounts of data. In fact, even Windows Task Manager labels it as "Not Responding."
Try finding a folder on your computer with many files. While Picture Viewer begins to load from that folder, leave the Picture Viewer window (for this window, perhaps.) Upon returning to Picture Viewer, you are presented with nothing but a white screen throughout the entire form. I know now that the program is not frozen (or in an infinite loop, perhaps) but when I first ran it, I was worried.

In regards to the "x", my apologies. I use a window skinner (WindowBlinds 4.5) that skins every window on my screen. While it can be a very helpful (and stylish) tool, it apparently has its flaws ;)

MartinLiss
Jul 12th, 2008, 04:01 PM
Updated to V1.1

MartinLiss
Jul 13th, 2008, 12:24 PM
hfp, please let me know how it works.

half flung pie
Jul 14th, 2008, 11:18 AM
I love it! It works very fluidly for me now.

I changed picRightPane's AutoRedraw property to True because if you put something in front of it, the picturebox would turn black.

Changing that property also messed with the picture flutter, although I'm not sure whether to call it a "helpful" or "harmful" change. The Picturebox no longer flutters, but the actual resizing of the form jitters now.

I've thought of a way that could reduce the picture flutter, but I'm not sure how practical it is (or even if it is a good idea). Tell me what you think.

I believe right now you have something to the effect of
Private Sub Form_Resize()
Resize picRightPane
End Sub
(In simplest form.)

Could something like this be used?
Private Sub Form_Resize()
If (Left mouse button isn't down) Then
Resize picRightPane
End If
End Sub
That way the form can be resized to your heart's content, but the picture won't redraw until you're actually done resizing (you lift the left mouse button). I'm not sure how practical this "method" is. It might look ugly, I'm not sure. Anyways, that's my take on the fluttering picture thing.

:) Great app!

MartinLiss
Jul 14th, 2008, 11:22 AM
Thanks, I'll look into those things. I've also found and corrected some problems with the zooming function and I'll have an update soon.

MartinLiss
Jul 15th, 2008, 01:56 PM
Updated to V1.2

MartinLiss
Jul 25th, 2008, 07:55 PM
Updated to Version 1.3

MartinLiss
Jul 28th, 2008, 10:25 AM
Please see post #1 concerning a serious problem.

MartinLiss
Aug 3rd, 2008, 03:34 PM
Please see post #1 concerning a serious problem.
Updated and corrected to Version 1.4

MartinLiss
Aug 18th, 2008, 10:07 AM
Updated to Version 1.5

MartinLiss
Feb 27th, 2010, 04:55 PM
Updated to version 1.7

rajbdilip
May 29th, 2010, 02:17 AM
Hello.
I downloaded it with MissingOCX.zip but when I open the project, it says NumberBox.ocx couldn't be loaded.

MartinLiss
May 29th, 2010, 10:13 AM
You can create your own by compiling this (http://www.vbforums.com/showthread.php?t=231163).

RayComp
Jul 10th, 2010, 08:36 AM
Greetings from South Africa. I came across Picviewer code and downloaded the zip file containing the code, NumberBox.ocx and freeimage.dll

Both files are in the directory where the Picture Viewer.vbp is located.
I then registered NumberBox.ocx from the apps directory - result DIIRegisterServer in D:\Picview\numberbox.ocx succeeded

Loading the Picture Viewer.vbp get message D:\Picview\NumberBox.ocx could not be loaded.

Running the project in any case I received error message when clicking on the treeview and had to remove all references in the code referring to nbrGoTo.Text before I could run the project. After that the program worked OK except that I can not access the files inside the folders.

Should I do something (register?) freeimage.dll or not?
What else do I need to do?


Running Windows 7

Andrewpeter
Nov 14th, 2011, 09:54 AM
Hi MartinLiss, thank you for your sharing, it's nice. If I want to zoom (in or out) by mousewheel then what do I do? How? Thanks.
(It likes "windows picture and fax viewer" of windows).

MartinLiss
Nov 14th, 2011, 11:55 AM
You'll have to make code changes of course and I can't do that since I don't have a mousewheel, but perhaps this thread (http://www.vbforums.com/showthread.php?t=388222) or others you could search for here will help.

Andrewpeter
Nov 15th, 2011, 12:43 AM
Thank MartinLiss, that is my need. It's very nice.

MartinLiss
Nov 15th, 2011, 11:25 AM
Your welcome. If you have any suggestions to improve it please let me know.