How to load a GIF image file
Posted: Sat Jan 13, 2007 4:08 pm
For loading all images, I use the following function to setup the param structure :
GFL_LoadParams PROC USES EBX EDI ESI,__lpGflParams:LPGFL_LOAD_PARAMS
mov eax,__lpGflParams
test eax,eax
jz @Exit
mov edi,eax
INVOKE gflGetDefaultLoadParams,eax
and eax,0000ffffh
jnz @Error
or (GFL_LOAD_PARAMS Ptr [edi]).Flags,GFL_LOAD_SKIP_ALPHA ;GFL_LOAD_ORIGINAL_DEPTH
mov (GFL_LOAD_PARAMS Ptr [edi]).Origin,GFL_TOP_LEFT
mov (GFL_LOAD_PARAMS Ptr [edi]).ColorModel,GFL_ARGB
mov (GFL_LOAD_PARAMS Ptr [edi]).DefaultAlpha,255
mov (GFL_LOAD_PARAMS Ptr [edi]).LinePadding,4
mov eax,edi
jmp @Exit
@Error :
xor eax,eax
@Exit :
ret
GFL_LoadParams ENDP
; ================================================================================
This works welle for many format, but not for GIF. Why ?
GFL_LoadParams PROC USES EBX EDI ESI,__lpGflParams:LPGFL_LOAD_PARAMS
mov eax,__lpGflParams
test eax,eax
jz @Exit
mov edi,eax
INVOKE gflGetDefaultLoadParams,eax
and eax,0000ffffh
jnz @Error
or (GFL_LOAD_PARAMS Ptr [edi]).Flags,GFL_LOAD_SKIP_ALPHA ;GFL_LOAD_ORIGINAL_DEPTH
mov (GFL_LOAD_PARAMS Ptr [edi]).Origin,GFL_TOP_LEFT
mov (GFL_LOAD_PARAMS Ptr [edi]).ColorModel,GFL_ARGB
mov (GFL_LOAD_PARAMS Ptr [edi]).DefaultAlpha,255
mov (GFL_LOAD_PARAMS Ptr [edi]).LinePadding,4
mov eax,edi
jmp @Exit
@Error :
xor eax,eax
@Exit :
ret
GFL_LoadParams ENDP
; ================================================================================
This works welle for many format, but not for GIF. Why ?