JScript Posted March 12, 2011 Share Posted March 12, 2011 Hello everyone, Maybe the question is a little silly, but I do not know much about programming... So could someone help me in code below? How to add the following parameters: Quality together with other(s) parameter(s)? Example:$tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", 70) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($tData)) #include <GDIPlus.au3> #include <ScreenCapture.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hBitmap, $hImage, $sCLSID, $tData, $tParams ; Capture screen _ScreenCapture_Capture (@MyDocumentsDir & "\GDIPlus_Image.jpg") ; Initialize GDI+ library _GDIPlus_Startup () ; Load image $hImage = _GDIPlus_ImageLoadFromFile (@MyDocumentsDir & "\GDIPlus_Image.jpg") ; Get JPEG encoder CLSID $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG") ; Set up parameters for 90 degree rotation $tData = DllStructCreate("int Data") DllStructSetData($tData, "Data", $GDIP_EVTTRANSFORMROTATE90) $tParams = _GDIPlus_ParamInit (1) _GDIPlus_ParamAdd ($tParams, $GDIP_EPGTRANSFORMATION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Data")) ; Save image with rotation _GDIPlus_ImageSaveToFileEx ($hImage, @MyDocumentsDir & "\GDIPlus_Image2.jpg", $sCLSID, DllStructGetPtr($tParams)) ; Shut down GDI+ library _GDIPlus_ShutDown () EndFunc ;==>_Main http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Andreik Posted March 12, 2011 Share Posted March 12, 2011 I think is the same for more parameters [not tested] $tData = DllStructCreate("int Rotate; int Quality") DllStructSetData($tData, "Rotate", $GDIP_EVTTRANSFORMROTATE90) DllStructSetData($tData, "Quality", 10) $tParams = _GDIPlus_ParamInit (2) _GDIPlus_ParamAdd ($tParams, $GDIP_EPGTRANSFORMATION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Rotate")) _GDIPlus_ParamAdd ($tParams, $GDIP_EPGQUALITY, 2, $GDIP_EPTLONG, DllStructGetPtr($tData, "Quality")) When the words fail... music speaks. Link to comment Share on other sites More sharing options...
JScript Posted March 12, 2011 Author Share Posted March 12, 2011 I think is the same for more parameters [not tested]$tData = DllStructCreate("int Rotate; int Quality") DllStructSetData($tData, "Rotate", $GDIP_EVTTRANSFORMROTATE90) DllStructSetData($tData, "Quality", 10) $tParams = _GDIPlus_ParamInit (2) _GDIPlus_ParamAdd ($tParams, $GDIP_EPGTRANSFORMATION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Rotate")) _GDIPlus_ParamAdd ($tParams, $GDIP_EPGQUALITY, 2, $GDIP_EPTLONG, DllStructGetPtr($tData, "Quality"))I had tried this before, not working...And this line: _GDIPlus_ParamAdd ($tParams, $GDIP_EPGQUALITY, 2, $GDIP_EPTLONG, DllStructGetPtr($tData, "Quality"))[/code] should be this: _GDIPlus_ParamAdd ($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Quality"))[/code] http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted March 13, 2011 Author Share Posted March 13, 2011 Someone? I do not think it was so difficult... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted March 16, 2011 Author Share Posted March 16, 2011 Does anyone ever faced this situation before? Any help will be great... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now