SaveBuffer as PNG or JPEG?

Blitz3D Forums/Blitz3D Programming/SaveBuffer as PNG or JPEG?

DheDarkhCustard(Posted 2009) [#1]
Does anyone know of any libs or code that lets me export buffers as anything other than BMP?

Thanks.


Warner(Posted 2009) [#2]
FreeImage?
http://www.blitzbasic.com/codearcs/codearcs.php?code=1732


Virtech(Posted 2009) [#3]
Is it possible using Freeimage to specify the compression ratio of saved .jpg?
The default quality seems very low.


Ross C(Posted 2009) [#4]
You can specify the compression ratio in freeimage. I believe it's an optional parameter in the function.


Virtech(Posted 2009) [#5]
Hi

From the freeimage decls there is no extra parameter for specifying the compression ratio of jpg's.

Im using the command - FiSaveImage(img, filename$)


big10p(Posted 2009) [#6]
This is the FreeImage lib I use (FI_B3D_min.bb):


And here's the decls (FreeImage.decls):


As you can see, the SaveJPG function allows you to speicify the compression in the 3rd parameter.


Virtech(Posted 2009) [#7]
Yes i can see your version have the extra parameter, but mine doesn't :/
I couldnt run your files because of missing function "RtlMoveMemory_From"


big10p(Posted 2009) [#8]
Oh, sorry. You'll also need this decls, too:

kernel32.decls
.lib "kernel32.dll"
RtlMoveMemory_To%(Destination%,Source*,Length%) : "RtlMoveMemory"
RtlMoveMemory_From%(Destination*,Source%,Length%) : "RtlMoveMemory" 
RtlMoveMemory_Ex%(Destination%,Source%,Length%) : "RtlMoveMemory"