I'm testing a very simple module able to load BMP, ICO, JPG, TGA, PNG and TIFF images.
Target of the module is very precise and limited: the ability to load different images format other than just BMP and return a handle to windows bitmap of the image so functionalities are very few but I think enough to be very very useful for many activities.
Syntax of the new keywords inside the module are the following:
[code=thinbasic]hBmp = TImage_Load(nIdx, ImageFileName)
lResult = TImage_Save(nIdx, ImageFileName, nType)
lResult = TImage_Unload(nIdx)
Width = TImage_Width(nIdx)
Height = TImage_Height(nIdx)
hBmp = TImage_Handle(nIdx)[/code]
Where:
- nIdx is a user unique number used to identify the image and is assigned during TImage_Load. Just use a number like 1 or 2 or 3 or whatever number you like. nIdx is than used in all other functions to identify the image.
- nType is one of the following equates: %TImage_BMP, %TImage_JPG, %TImage_PNG
I would like to have some feedback and tests. It should work on Win9x systems withoutthe need of GDI+ library but it needs Microsoft Visual C runtime (that should be present mainly on all Win9x systems)
If there will be no big problems I will deliver with official release.
Attached: module dll, module sources, example.
Thanks a lot
Eros
ps: TImage module takes advantages of PBIMAGE.DLL By Dean Hodgson I've found on another forum. PBIMAGE.DLL is loaded at module runtime from module resource directly into process memory.
Bookmarks