Page 1 of 1

VB .Net 2003 Generating Thumbnails for Videos?

Posted: Thu Dec 22, 2005 10:20 pm
by SirWinner
I posted this at:
http://forums.microsoft.com/MSDN/ShowPo ... 4&SiteID=1

---


I'm able to use this code in my Visual Basic 6 programs to generate Thumbnails of Videos and Pictures:
http://www.vbaccelerator.com/home/NET/C ... rticle.asp

This code is in Visual C .Net and cannot be rolled into my VB .Net 2003 Project without converting it:
http://www.vbaccelerator.com/home/VB/Co ... rticle.asp

In VB.Net 2003, it is very easy to do the thumbnails for the 9 "known" picture file types.

The problem is this --> I have a large VB.Net Project that generates picture thumbnails that also needs to generate Thumbnails images from Video files on the fly.

Telling me to rewrite my project in C# or C++ just won't cut it since my code has been fully tested and running well in VB.Net 2003. The project in question is presently in use!

Don't want to have another process running in the background or to call another program to generate the thumbnails because of many reasons... such as file locking issues, etc.

I've tried a few C#/C++ to VB.Net conversion programs that just don't seem to work properly.

Tried using the VB 6 to VB .Net 2003 conversion for the VB 6 code that does the thumbnails and that has major issues too.

*** Please NO flame wars over which computer language would be best since that degrades into character assassinations in the end. ***

Any hints on where to start?

---

Maybe the above would be useful to someone else.

My VB .Net Project needs the ability to do Video Thumbnails. I'm able to get the Picture Thumbnails using the "Thumbnail" stuff in VB .Net for Pictures.

Meanwhile back to the drawing board on how to resolve this issue.

:x

Posted: Thu Dec 22, 2005 11:31 pm
by Nirvana
Are you just using VB .NET compiler, or are you actually using the framework? You could possibly make a COM .NET DLL and do it that way (wouldn't involve multiple processes).

Posted: Mon Dec 26, 2005 5:18 pm
by SirWinner
Nirvana,

Using VB .Net 2003 in the main project.

Basically using just the VB .Net Compiler. I do, however, include the ".Net Framework" stuff in the installer program since there are a few calls to it.

There are 4 programs in this project. All of them need the capability to generate thumbnails on the fly.

The VB .Net "known" picture types (9 in all), I have thumbnail logic by loading the images into a picturebox then thumbnailing them using the standard thumbnail calls.

All other file types need to use the "thumbnail" logic that is in the VB 6 in the link above.

Therefore, I'll take your suggestion and make it into a VB6 DLL... then call it from my VB .Net Code.

Thanks,
SirWinner

Posted: Mon Dec 26, 2005 8:19 pm
by SirWinner
Nirvana,

Wrote 3 sample applications:

- DLL to be called. (VB 6)

- Application in VB 6 to call the DLL Function.

- Application in VB .Net to call the DLL Function.

Works just as it should... Finally... Took a fair amount of testing. :)

Now to write the actual DLL from the logic I have in VB 6 for the Thumbnails and then to call it from VB .Net! (Then if the Thumbnail was created, use it!)

Looks like we have the solution to the problem.

Thanks again!

:P

Posted: Tue Dec 27, 2005 3:35 pm
by SirWinner
Nirvana,

Thumbnail DLL is now created in Visual Basic 6... And I am able to pass parameters to it and receive the expected results in Visual Basic .Net application.

Passing these Values:

- Filename to thumbnail. (From Filename)
- Filename to save the generated thumbnail.
- Boolean flag. Returned value that tells if the thumbnail was generated or not.
- Desired Thumbnail Width.
- Desired Thumbnail Height.

If there is a file that is bad, the logic is smart enough to "know" that the thumbnail wasn't generated.

Otherwise the thumbnail file was generated.

Thanks again,
SirWinner

Posted: Fri Jan 06, 2006 12:08 am
by Nirvana
Cool, glad to help.

Sorry I didn't see this sooner, I forgot to check the coders corner for a while :P

Posted: Fri Jan 27, 2006 5:04 pm
by SirWinner
No problem... Glad to get any help in the matter.

I've installed the DLL for a customer using VB.Net code to call the DLL.

It just works without problems.

By the way, I had to use a hidden \"form\" to get the DLL to save the picture. Had no idea that a DLL would even allow a \"form\" to be used.

Hehehe!

:P