News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A nice jpeg library in asm ?

Started by BlackVortex, July 22, 2008, 02:42:30 AM

Previous topic - Next topic

Vortex

Raymond,

Thanks for the memGIF function.

Here is a demo displaying a GIF image from memory.

[attachment deleted by admin]

BlackVortex

Lazy question : The library can't work with moving gifs, right ?

Vortex

From the help file coming with the library :

QuoteSome GIF files may contain multiple images (i.e. animated GIFs). Only the first image of the file is rendered with this function. It is not expected that a function will ever be made available in this library to render animated GIFs. That would require the decoding of all the images in the file and the creation of a thread to handle the timing between the display of each of those images in succession.

RotateRight

BlackVortex,

Look into the function BitmapFromResource (found in Masm32.lib).

A couple of advantages to using it are having the source and an
exe that is several k bytes smaller.


BlackVortex

Quote from: RotateRight on July 24, 2008, 09:20:32 PM
BlackVortex,

Look into the function BitmapFromResource (found in Masm32.lib).

A couple of advantages to using it are having the source and an
exe that is several k bytes smaller.


Where can I find its documentation ? Where was it posted first ?

RotateRight

You will find the source code for the function in
the directory

\masm32\m32lib

Look at:

bitmapfromfile.asm
bitmapfrommemory.asm
bitmapfrompicture.asm
bitmapfromresource.asm

An old thread is here:

http://www.masm32.com/board/index.php?topic=937.0

Example by "the one and only" Vortex:

imagelib5.zip

http://www.masm32.com/board/index.php?action=dlattach;topic=937.0;id=1639

In his example (BmpFromRsrc) add

includelib \masm32\lib\masm32.lib

to link instead of ..\imagelib\image.lib
if you wish.

The functions will work several types of graphic formats.
I mainly use it for JPGs.


BlackVortex

You are right, this function is even better than Raymond's, at least for my goals. I can't believe it was in my masm32 all along, what a nub I am. Then again, seems some other ppl also missed it     :green

With this function, I've saved 4kb out of my final exe size, and my source is a little cleaner, cause I don't need to call those resource handling APIs myself, and the invoke I use is simpler etc.  Thanks !