AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add an AVI to your AHK Gui - CreateWindow_AVI.ahk [LIB]
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
not-logged-in-daonlyfreez
Guest





PostPosted: Wed Oct 25, 2006 10:52 pm    Post subject: Reply with quote

Sound doesn't seem to matter, clock.avi has sound.

The file loading thing: I think it depends on the avi's properties, mostly encoding. I tested, and bitrate doesn't seem to matter. If your avi is not too heavily encoded, it should work.

The good thing about this, is that one could use the already available animations (bitmaps, icons) to enhance one's Gui, without dragging it along with the 'installer'. Simply use what is already available, and optionally add your own.

It would be interesting to have a list of most probable Windows default dll avi resources on all versions of OSs. And exe's too.

Does anybody know how to extract and use the bitmap resources in dll's, exe's etcet. in your Gui? Icons can be accessed, but bitmaps not.

There is already so much available Wink Razz Twisted Evil Confused Shocked Very Happy Cool

Ok, I overdid it with the smiley's, I admit Wink Razz (got dragged into Goyyah-mode a bit Razz Wink )
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5594

PostPosted: Thu Oct 26, 2006 7:05 am    Post subject: Reply with quote

not-logged-in-daonlyfreez wrote:
There is already so much available Wink Razz Twisted Evil Confused Shocked Very Happy Cool


I would use only these: Wink Shocked Very Happy Cool

Regards, Very Happy
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Oct 26, 2006 8:55 am    Post subject: Reply with quote

not-logged-in-daonlyfreez wrote:
Sound doesn't seem to matter, clock.avi has sound.
Ah, I did the tests on a computer without sound driver... And MSDN keep advising against files with sound, but perhaps they improved the stuff, or just want to avoid people to show a full DVD show while copying files. Wink

Quote:
The file loading thing: I think it depends on the avi's properties, mostly encoding. I tested, and bitrate doesn't seem to matter. If your avi is not too heavily encoded, it should work.
Yes, one problem is that AVI format is actually an empty shell (the Riff format) and videos can be encoded with various codecs. I don't know if the control is depending on the installed codecs or expected a precise video encoding.

Quote:
Does anybody know how to extract and use the bitmap resources in dll's, exe's etcet. in your Gui? Icons can be accessed, but bitmaps not.
I have seen softwares, some being freewares, to extract these resources.
Hey, I even have one: Resource Hacker.
I loaded MSGina.dll with it, saved the AVI resource, and was able to use it with your script. Cool...

Goyyah wrote:
What would be the hard way? Read the file header with Binary routines?
Yes... See AVI File Format. Wink
Now, I have found an open source utility (which give info on the format as well): YAAI - Yet Another Avi Info.
Alas, it chokes on the AVI extracted from the DLL and those generated from Gif files, probably because they have no sound. Works OK with clock.avi.

[EDIT] Found another interesting utility: abcAVI Tag Editor, I will see if it is interesting.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on Thu Oct 26, 2006 9:08 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5594

PostPosted: Thu Oct 26, 2006 9:05 am    Post subject: Reply with quote

PhiLho wrote:
Goyyah wrote:
What would be the hard way? Read the file header with Binary routines?
Yes... See AVI File Format. Wink


Too much for me .. Shocked
I thought it would be as simple as a DWORD in a BMP header! Sad

Thanks. Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Oct 26, 2006 9:32 am    Post subject: Reply with quote

Hey, abcAVI Tag Editor 1.8.1 is excellent!
It shown that two of my files have errors, that all of them have no sound, is able to show the codec and even the AVI file structure!
Wow. Good interface too, it supports drag'n'dropping multiple AVI files.
Hum, the export to clipboard doesn't work. [EDIT] Yes it does, but don't have a default format. I have to choose one. Very flexible system.

For example, the CtrlAltDel.avi file extracted from MSGina.dll:
Duration: 0 h 0 min 4,97 s
Video stream: Run length encoded 8bpp RGB image <0x00000001>, 200x120, 8 bit, 71 frm, 14,2857 frm/s, 22,130 kbit/s
Video quality: 1941 eff.bits per frame 3x4

Clock.avi:
Duration: 0 h 0 min 12,00 s
Video stream: Run length encoded 8bpp RGB image <0x00000001>, 321x321, 8 bit, 12 frm, 1,0000 frm/s, 43,497 kbit/s
Video quality: 32705 eff.bits per frame 3x4
Audio stream: DSP Group True Speech <0x0022>, 8000 Hz, 1 bit, 8,536 kbit/s, Mono

Torch.avi (made from a Gif, not displayed by the control):
Duration: 0 h 0 min 0,60 s
Video stream: Microsoft Video 1 'CRAM' <0x4D415243>, 18x32, 16 bit, 6 frm, 10,0000 frm/s, 27,040 kbit/s
Video quality: 1144 eff.bits per frame 3x4

Ruby.avi (found in MS Platform SDK, not displayed):
Duration: 0 h 0 min 8,60 s
Video stream: Cinepak by CTi (ex. Radius) Vector Quantization 'cvid' <0x64697663>, 320x240, 24 bit, 86 frm, 10,0000 frm/s, 1859,704 kbit/s
Video quality: 186437 eff.bits per frame 3x4

I guess that AVIs displayed by the control must have a RLE (run lenght encoded) stream...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
not-logged-in-daonlyfreez
Guest





PostPosted: Thu Oct 26, 2006 12:43 pm    Post subject: Reply with quote

If you have a nice animated Gif that you'd like to add to your Gui: I found this program:

Gif2Avi (freeware, 180k, Gui)

I converts animated Gifs directly to Avi, and has a RLE compression option, so generated files are made smaller, but can still be shown in an AHK Gui Cool

Ofcource, there is usually a considerable size increase when converted, but alas, nothing much can be done about that, I guess...

@PhiLho: Regarding the resourced bitmaps, I think you misunderstood. I would like to be able to use them in a Gui directly, without having to extract them first, like we do with this script with AVI resources (or files now too).
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5594

PostPosted: Thu Oct 26, 2006 12:48 pm    Post subject: Reply with quote

not-logged-in-daonlyfreez wrote:
Gif2Avi (freeware, 180k, Gui)


Thanks for the link daonlyfreez! Downloaded it.. Yet to try but looks nice!

Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Oct 26, 2006 12:53 pm    Post subject: Reply with quote

Img2Avi Jpg2Avi Bmp2Avi Gif2Avi

not-logged-in-daonlyfreez wrote:
@PhiLho: Regarding the resourced bitmaps, I think you misunderstood. I would like to be able to use them in a Gui directly, without having to extract them first, like we do with this script with AVI resources (or files now too).
OK, I was confused by the "extract" term...
It shouldn't be too hard to support such resources, will take a look later.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5594

PostPosted: Thu Oct 26, 2006 12:57 pm    Post subject: Reply with quote

PhiLho wrote:
Img2Avi Jpg2Avi Bmp2Avi Gif2Avi


Wow! ..

BTW, I more interested in splashing an animated screen! Is AVI the only way to go?

Rolling Eyes
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
not-logged-in-daonlyfreez
Guest





PostPosted: Thu Oct 26, 2006 1:58 pm    Post subject: Reply with quote

@PhiLho: I tried the freeware you provided, but it doesn't generate the desired result even when fed the images in the Gui, and it shows a 'splash msg' if you run it from the command line, which prevents it from working, and - according to the site

Quote:
convert your VisionGS webcam archive (images)


which is a "format" I haven't been able to feed thru the command line (it looks like it expects something like 0000000001.jpg, 0000000002.jpg etcet. ).
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Oct 26, 2006 2:27 pm    Post subject: Reply with quote

Well, I must admit I posted without testing first...
I ran the program, and despite a warning in the About box that it should be used only with images generated by the VisionGS utility, I was able to load 9 PNG images of same size and generate an AVI file (using compression 0, ie. no compression) that is shown by the script. Using the interface, not the command line.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Oct 26, 2006 5:57 pm    Post subject: Reply with quote

not-logged-in-daonlyfreez wrote:
I would like to be able to use them in a Gui directly, without having to extract them first, like we do with this script with AVI resources (or files now too).
Among other possibility, I see it can be done with GDI+ too: GdipCreateBitmapFromResource
Now, I don't know if these images are so common and of general interest to spend some time on it.

Goyyah wrote:
Animated GIF ?!!
Not supported natively by Windows. I saw an article showing how it can be done with GDI+: Adding GIF-animation using GDI+ - The Code Project - GDI+. I didn't read the whole stuff, but it seems it uses GDI+ to extract the frames and info, then display the frames with a timer...
Otherwise, we should find a DLL doing this. So far, I found only OCXes, which aren't usable within AHK.
Or perhaps with a browser DLL: Viewing Animated GIF Files with LBbrowse.DLL

Also Multiframe Images with GDI+...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5594

PostPosted: Thu Oct 26, 2006 6:32 pm    Post subject: Reply with quote

Dear PhiLho, Smile

Thanks for all the information!

PhiLho wrote:
Goyyah wrote:
Animated GIF ?!!
Not supported natively by Windows.


I was not aware that it would be so tough! I hope someday Mr.Chris will add built-in support for it! Micha has included A-GIF support in a MFC based DLL : New controls on GUI windows (Buttons, Statics, HMTL, RTF...). If someone could create a non-MFC DLL , it would ease Mr.Chris' work in implementing it, I guess!

Right now I will be contended with displaying a AVI animation. Many thanks to you & daonlyfreez for this wonderful solution!

Very Happy
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Mon Nov 06, 2006 3:01 pm    Post subject: Reply with quote

I just got around to reading this topic. Nice work!

This should help me implement, test, and document the AVI control when the time comes. In the meantime, if anyone would like to package this up into something more succinct and easy-to-use (assuming that's feasible), I could include it as an example on the GuiControls page.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Stefan14
Guest





PostPosted: Fri Nov 10, 2006 11:51 pm    Post subject: Reply with quote

the demo works, yes Smile but how can i use it in my small gui with a small avi??? Sad
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 3 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group