srod wrote:There is also an ActiveX control bundled up with COMatePLUS which shows animated gifs etc.
Sorry, srod, for the omission. I am just getting old...
Even the older COMate and PureDispHelper libs contained an example code for animated GIFs from Kiffi...
No need to aplogise; indeed there is nothing to apologise for. I was just adding yet another option. Admittedly, I'd probably go with the web-gadget option myself.
I may look like a mule, but I'm not a complete ass.
I need to write a JPEG using 4:2:2 subsampling (the PB JPEG lib seems to write at 4:4:4 all the time) so I'm come to the FreeImage lib to help me write out an JPEG image created in PB using CreateImage etc (e.g. see below). However the pointer to the image provided by PB seems to be not compatible with the one expected by FreeImage. I'm not so familiar with PB's internal image format. I wonder if anyone's had any experience to save an image using FreeImage like how I'm trying it. I'd be grateful for a suggestion.
If comp
bm.BITMAP
GetObject_(ImageID(comp), SizeOf(BITMAP), @bm)
dib = FreeImage_Allocate(bm\bmWidth, bm\bmHeight, bm\bmBitsPixel)
; the GetDIBits function clears the biClrUsed And biClrImportant BITMAPINFO members (dont't know why)
; so we save these infos below. This is needed for palettized images only.
; nColors = FreeImage_GetColorsUsed(dib)
dc = GetDC_(#Null)
success = GetDIBits_(dc, ImageID(comp), 0, FreeImage_GetHeight(dib), FreeImage_GetBits(dib), FreeImage_GetInfo(dib), #DIB_RGB_COLORS)
ReleaseDC_(#Null, dc);
; restore BITMAPINFO members
; *bmInfo.bitmapinfo = FreeImage_GetInfoHeader(dib)
; *bmInfo\bmiHeader\biClrUsed = nColors
; *bmInfo\bmiHeader\biClrImportant = nColors
EndIf
The parts I've commented out are not needed except perhaps for the case indicated in the original comments.