The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Avalon on February 17, 2005, 11:40:16 AM

Title: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 17, 2005, 11:40:16 AM
HI, I´m a newbee,

I have read some tut´s but I´m searching for a possibility to "draw" a animated Gif to a window.

Til now i have explore some expirience with Bitmap format and JPG.

But til now i cound´n found any tut of Gif.

How can I realize?

Many thankx in advance.

Avalon

Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: pbrennick on February 17, 2005, 03:27:40 PM
Avalon,
I am sure that this is very possible but it is not anything that I am able to do very well.  I grew up in a nongraphical environment and am a late player in that arena.  Why don't you send an email to Donkey?  He is, I think, one of the acknowledged professionals in this area and is very approachable.  He has been having some network problems that he has gone a long way towards solving.  But he might miss this post.

Paul
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: QvasiModo on February 17, 2005, 08:03:53 PM
This link may help. :)
http://www.winasm.net/index.php?ind=downloads&op=entry_view&iden=67
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 17, 2005, 09:36:28 PM
Many thanks,

first of all, i´m sorry for my poor english, ::) i´m doing my best to explaine.

AniGiff viever is very well, :U

BUT

it needs / loading an AniGIF.dll .

I need only one PRG / exe file no dl other things.

as compact as possible.

how can be made reverse dll and take only the thinkg i need?

or intergrate dll in main.

Avalon



Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: pbrennick on February 17, 2005, 11:43:37 PM
Avalon,
Let's not talk about reversing.
Paul
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: NaN on February 18, 2005, 05:27:48 AM
FYI, our ObjAsm32 Package has a GIF object that will load and display GIF's for you...

Check out this link:

http://www.masmforum.com/simple/index.php?topic=712.0

Regards,
:NaN:
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: QvasiModo on February 18, 2005, 06:11:45 PM
Who would ever need to reverse an open source library? ::)

Quote from: Avalon on February 17, 2005, 09:36:28 PM
how can be made reverse dll and take only the thinkg i need?
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 18, 2005, 09:20:53 PM
Hi at all,

reverse means to intergrate the code to main NO more.

that I wand to do is not to "load" some picture no i wand to display Animated Gif on windows.

Avalon.

PS I´m sorry but I could not found the code for the displayer.

Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: QvasiModo on February 19, 2005, 02:05:41 PM
The library uses the OLE apis to decode each frame in the GIF file (take a look at AniGif.asm, not GifViewer.asm). Perhaps what you want is the GIF file format instead?
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: pbrennick on February 19, 2005, 04:15:31 PM
Avalon,
Are you primarily interested in the animation or the file type.  If you do not mind working with bitmaps as long as you get the animation that you desire; I have attached something that has been developed by William Cravener that is way cool!  As an example it is very easy to grow from.

Paul


[attachment deleted by admin]
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Mark Jones on February 19, 2005, 09:24:36 PM
Great example, thanks Paul!  :U
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 20, 2005, 01:42:47 PM
Animate is a great example how to do  :U :U :U

Now my questions:

1. how can I transfer my Gif file to bitmap? (sceene by sceene or frame by frame the same)

1.1 How can i export "only" the bit´s and byte in writting format  e.g. (textformat)

Frame 1,

Byte 00,FF,80,90,00, ...

Frame 2

and so on

Colortab and so on


2. exist a function to change "only" the color map (RGB)?

3. The file will be going very "huge" is there a possibility to "compress" it with e.g. Hufmann and decompress direct to memory?

What I wanna do:

Frame 1
Frame 2
Frame 3
.
.
.
frame 9

and so on

The frames has the same y and x size

they have the same color tab

to save memory (filesize) to put all frames to gether only onetime save the colortab and compress with huffmann

decompression:

allocate memory for each frame
and writte directly to Memory ==> endcompressed dates and colortab

I remember this way on 68H000 prz. (Hardware scrolling with bitclipp the same procedure)

My question to change the "colortab" is in this way (the fastes way to chance background)
You can make in this way some nice effects. (scrolling colors)

Best regards,

Aladin






Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: pbrennick on February 20, 2005, 03:45:47 PM
Avalon,
I am pretty much an afficiando of Paint Shop Pro.  There is a shareware version available while you are testing and deciding if you want to buy it.  Take an animated GIF that is owned by you, open it up in the Animation Wizard (a separate program that comes with the package.  Select all the images and export tham to PSP.  Now you can do a batch conversion from GIF to bitmap.  The option is in the File menu.  For now, accept all the defaults and do the conversion.  Now you must save all the bitmaps.

Once that is done, you can use a tool, a part of masm32, IIRC, to dump each bitmap as a rcdata thing.

Paul

BTW: PSP has a much gentler learning curve than some other products.
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: pbrennick on February 20, 2005, 03:50:45 PM
Avalon,
As far as manipulating the color bits and what not once the dump has occurred?  This is outside of my field of expertise.  I think I have given you enough to get started.  When you finish the prelim stuff, you can post a question to one of the graphics gurus.

Paul
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: donkey on February 20, 2005, 04:24:33 PM
AFAIK GIF's are just RIFF files, it should be possible to decompress them programatically fairly easily. If you like you can email me a GIF that you want to use and I'll take a look at displaying it.
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 21, 2005, 08:23:28 PM
HI,

many thanks for all repies.

Till now i don´t know thich way is the best:

the results until now:

My sample Gif was 25 KB

18 Frames in bmp each frame 10 KB (with colortable) sumary: 180 KB

in PNG and JPG near the same results. near 135 KB

At the moment I´m study a sample how to compres / decompres GIF files on the fly, but i do not realy unerstand the source (print and studi  :toothy)

We will see tomorow.

Avalon


Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Mark Jones on February 21, 2005, 09:03:21 PM
There is also UPX, http://upx.sourceforge.net/ - that seems to work well on bloated files. :U
Title: Re: Is it possible / how to draw a GIF Animated file in a window?
Post by: Avalon on February 22, 2005, 09:11:48 AM
Hi Mark,
hi at all,

it´s a good idea to compress the exe file, but

first of all i will make compact code

then compact exe  :green

The project will be realized in

Take GIF format ==> decompress on the fly ==> make different bitmaps in memory (each frames) ==> bitblt bitmaps (Animation)

After i dump the GIF (thanks to Paul :U) i have separate the graphic information and color and so on information overhead from the gif and save only the graphic data to a file.

Now i can include it  separately. (This part is ready no changes)

I was surpriced what kind of information is stored in a GIF file sometimes is like M$ there is a lot of rubbish inside so i can delete some bytes, grat help was the side http://www.wotsit.org/

I´m thinking abaut include alpha cannel information make from 24 bit convert to 32 bit ( RGB ==> ARGB by 8 bit each channel)


We will see if it´s works.  :cheekygreen:

The size of code is at the moment 46 kb (without compression Mark :green)!


If somebody has some good ideas, let me know.



Avalon