Hi all,
how I can, lower the resolution the compression to image JPG, with the GdipSaveImageToStream function. using EncoderParameters?
thank you
Using Image Encoders and Decoders (https://msdn.microsoft.com/en-us/library/windows/desktop/ms533814%28v=vs.85%29.aspx) (see the point: Setting JPEG Compression Level)
The member named value of the structure EncoderParameter is storing the compression ratio :
EncoderParameter STRUC
pGUID GUID <>
NumberOfValues DWORD ?
vType DWORD ?
value DWORD ?
EncoderParameter ENDS
EncoderParameters STRUC
Count DWORD ?
Parameter EncoderParameter <>
EncoderParameters ENDS
.data
ImgQuality dd 50
.
.
.code
mov EncoderParameters.Parameter.value[esi],OFFSET ImgQuality
An example :
http://www.jose.it-berater.org/smfforum/index.php?topic=1860.0
this is an interesting subject :biggrin:
i have an older program named PicView
it seems to use IImageCtx to work with JPG's
when i convert an image to JPG, it offers controls for both "Quality" and "Smoothing"
i haven't taken the time to figure out how it works :P
CLSID EncoderQuality {1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB} ?
This way?EncoderQuality GUID <01D5BE4B5H,0FA4AH,0452DH,<09CH,0DDH,05DH,0B3H,051H,005H,0E7H,0EBH>>
uQuality dd 50
_EncPars EncoderParameters < 1, \
< <01D5BE4B5H,0FA4AH,0452DH,<09CH,0DDH,05DH,0B3H,051H,005H,0E7H,0EBH>>, 1, 4, uQuality> \
>
thank all, but Vortex, I have to move values to properties, pGUID, NumberOfValues, vType?.
or not is necesary.
MSDN show this method to change the format of a file
https://msdn.microsoft.com/en-us/library/windows/desktop/ms535406(v=vs.85).aspx
Hi AsmAlmeria12,
Attached is an example converting a bitmap to jpg.