News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

level lower the compression in images jpg.

Started by Fraile, October 23, 2015, 05:56:29 AM

Previous topic - Next topic

Fraile

Hi all,

how I can, lower the resolution the compression to image JPG, with the  GdipSaveImageToStream function. using EncoderParameters?

thank you


qWord

MREAL macros - when you need floating point arithmetic while assembling!

Vortex

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

dedndave

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

TWell

#4
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> \
>

Fraile

thank all, but Vortex, I have to move values to properties,  pGUID, NumberOfValues, vType?.
or not is necesary.

TouEnMasm

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
Fa is a musical note to play with CL

Vortex

Hi AsmAlmeria12,

Attached is an example converting a bitmap to jpg.