Page 1 of 1

Posted: Thu Oct 24, 2002 8:42 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi @ all
I need to display a 512x512 big GifAnim in an WebGadget for an application for mess presentation! On the company notebook and on my pc, like most other company PCs the program slows so mutch down that you cant really work with it (it will still hang and need 100% CPU power when showing the next animated gif part... Else the CPU is at about 5-10% of use...

The anim will not display smooth... really terrible! Any idea why does this happen (L1/L2 cache?) - On a friend PC it works fine and smooth!

If you have any idea how to solve this problem, please help me! I still need only an animation inside an application (but without borders, so i used WebGadget)

Thx in advance!

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Thu Oct 24, 2002 9:11 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> The anim will not display smooth... really terrible!

What code are you using to show it? My tip? And where can I get a
copy of the animgif so I can test it for myself? Thanks...


PB - Registered PureBasic Coder

Posted: Thu Oct 24, 2002 9:25 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi PB
Please give me your email and i will send you the stuff! Thx in advance! [url]mailto:twill@gmx.de[/url]

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Fri Oct 25, 2002 12:57 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> Please give me your email and i will send you the stuff!

Done. :)

However, for everyone else's benefit, here is a copy of what I just
sent you, after looking at your code/problem in detail -- perhaps
someone else here can assist further?

--- Start Quote ---

> the problem is that the anim will slow very down

This also happens to me with W2K Pro in Internet Explorer 6. :( This means that PureBasic
is NOT at fault, because the WebGadget uses IE to show the animation, and if IE shows it
slowly then there's nothing the WebGadget (or PureBasic code) can do to speed it up...

Some good news: The animation runs at NORMAL speed in Animation Shop and other anim viewers,
meaning that this definitely proves that IE is the reason for the slowdown, and not your PC.
So, it's not your L1/L2 cache as you asked, or anything to do with your hardware or system.

Can you rebuild the animation from scratch, perhaps at a smaller size and/or colour depth?
This may help in forcing IE to display it at normal (or near-normal) speed. If you can't
do that, all I can suggest is breaking it down into several smaller animations and display
each of them in turn, instead of one long animation. This may be harder to code, but might
work, because then the WebGadget won't have to load such a big animation into memory.

> On my pc i will see everytime the animation.. but on some company PCs
> (WinXP, WinNT4 for example) there will be NO anim displayed...

I can confirm this for NT4, evem with ATL.DLL installed correctly. :( I don't know why.

--- End Quote ---



PB - Registered PureBasic Coder

Posted: Fri Oct 25, 2002 1:09 am
by BackupUser
Restored from previous forum. Originally posted by TheBeck.

How about converting the GIF to AVI and use the movie library?

Posted: Fri Oct 25, 2002 1:14 am
by BackupUser
Restored from previous forum. Originally posted by TheBeck.

UPDATE:
I was able to display a .GIF file in media player so maybe it will also play an animated .GIF without having to be converted to .AVI? Worth a shot.

Posted: Fri Oct 25, 2002 1:36 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> I was able to display a .GIF file in media player so maybe it will
> also play an animated .GIF without having to be converted to .AVI?

THAT'S IT! Nice one, TheBeck.

MrVainSCL: The following code plays your animation at normal speed
for me, perfectly. However, you'll obviously need to amend your
code a bit... perhaps putting the other gadgets on the right side
of the window instead of the left, because the animation will be
at positions 0,0 on the window. Give it a try!

Some notes: I didn't test if you need the gif extension or not.
Also, there is a delay when the animation first loads, before
it starts to animate... can you live with that?

Code: Select all

If OpenWindow(0,150,150,512,512,#PB_Window_SystemMenu,"Test")
  CreateGadgetList(WindowID())
  InitMovie()
  r=LoadMovie(0,"LMLN_GifAnimation.gif")
  PlayMovie(0,WindowID())
  Repeat
    ev=WaitWindowEvent()
  Until ev=#PB_EventCloseWindow
EndIf

PB - Registered PureBasic Coder

Posted: Fri Oct 25, 2002 3:01 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi TheBeck
Many thanks for the great tip to use the MovieLib for it :wink: *COOL*
I havent had the idea to use it, hehe


Hi PB
Many thanks for the small code snip using the movie lib and the time you have spend to check my source and its problems!


Hi @ all
Using the MovieLib to dispaly GifAnims is really great and it works on my pc now smooth! (havent tested it yet on company pcs)

I have only to need, how (if there is any way!?) to display the 512x512 bif GifAnim with the MovieLib exactly on WindowPosition:

AnimGif must be at: x = 512, y = 128 ;(

I cant swap the left side (GUI) to right, where the GifAnim is atm!
Its defined by the company and i cant change it! ;((

So i have now a new problem... How to display the Anim, using MovieLib at the given postition without any border!??? :wink:)

Thanks in advance..




PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Fri Oct 25, 2002 3:49 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> how (if there is any way!?) to display the 512x512 bif GifAnim with
> the MovieLib exactly on WindowPosition: [snip] x = 512, y = 128

I haven't tested this: ResizeMovie(x, y, Width, Height)


PB - Registered PureBasic Coder

Posted: Fri Oct 25, 2002 4:10 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi PB
Yes, the command ResizeMovie() will solve the problem! Thx...

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Fri Oct 25, 2002 10:01 pm
by BackupUser
Restored from previous forum. Originally posted by TheBeck.
Hi TheBeck
Many thanks for the great tip to use the MovieLib for it :wink: *COOL*
I havent had the idea to use it, hehe
Glad to help. :)