News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Small update to deal with different image formats.

Started by hutch--, October 27, 2016, 06:11:43 PM

Previous topic - Next topic

hutch--

With the help of a few members who are literate in image handling, I have a viable technique for loading a variety of image formats from a resource file and converting them to bitmaps so they can be easily used in normal Windows API programs. The different formats seem to have different uses, PNG with its alpha channel support is the right choice for toolbar strips, for conventional RGB image data (photos etc ...) JPG is both flexible and able to be compressed to small sizes if you are careful with the level of compression chosen, TIF seems to work OK with alpha channel images but not as small as PNG and GIF if you don't mind a loss of image quality. There may be others but I have not tested them.

The attached zip file has to have its components added into the MASM32 installation manually as I don't know a safe way to do it without risking destroying any non standard modifications that a user makes.

1. There is a library module and the main INC file for the m64lib directory.
2. There is a later version of the macros64.inc file that must go into the macros64 directory.
3. There are a collection of QE scripts in the script64 that most go into the script64 directory.
4. There is a text file in the zip root dir called "menu_addin.txt" that shows what to modify in the " Edit - Settings - Edit Menus " to make the scripts available from QE.
5. There is a working example called "jpg_image" that is buildable AFTER you put the rest above in place AND run the "makeit.bat" file.  :biggrin:

Any feedback is welcome if its well informed.

LATER : Make sure you get the "masm64rt.inc" file posted below that I forgot to put in this zip file. It goes in the include64 directory replacing the earlier version.

jj2007

Quote from: hutch-- on October 27, 2016, 06:11:43 PM
5. There is a working example called "jpg_image" that is buildable AFTER you put the rest above in place AND run the "makeit.bat" file.  :biggrin:

jpg_image.asm(17) : error A2006:undefined symbol : GdiplusStartup

After adding GdiPlus.inc, I get
POLINK: error: Unresolved external symbol '__imp_GdiplusStartup'.
POLINK: error: Unresolved external symbol 'ResImageLoad'.
POLINK: error: Unresolved external symbol '__imp_GdiplusShutdown'.


So it seems that somewhere on the road you updated masm64rt.inc and the corresponding libs
\Masm32\lib64\gdiplus.lib is 3 October 2016, and it does have GdiplusStartup and GdiplusShutdown. Same for the inc file ::)

I got it working, partially, adding this under include \masm32\include64\masm64rt.inc in jpg_image.asm:    include \masm32\include64\GdiPlus.inc
    includelib \masm32\lib64\GdiPlus.lib

The exe is 21504 bytes, so the jpg is included, but the dialog remains empty.

Siekmanski

The executable works perfect.
Couldn't test the code. Maybe it's time for me to make the jump to Masm64 development as you guys.
Creative coders use backward thinking techniques as a strategy.

hutch--

 :biggrin:

Forgot to add MASM64RT.INC.  :P

I added the GDI+ lib and include to it.

hutch--

Marinus,

Once you get past the irritations, it seems to be an OK system, plenty of grunt and lots and lots of memory.