Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/11/2023 in all areas

  1. Note: https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script?
    1 point
  2. Jos

    FTP Download Progress bar?

    Wisdom after 11 years?
    1 point
  3. aeun01, Could you be any vaguer? From where are you copying the 0? Why do you need to change it to 1? Explain in more detail what it is that you want to do and we can make sensible suggestions to help. M23
    1 point
  4. So this will be last UDF version published this way (as attachment here). For future update please take a look: https://github.com/mlipok/ATCmd.au3 ATCmd_1.2.1.zip
    1 point
  5. Usually just need to split by @LF, if you copy text into something like NotePad++ and turn on symbols you'll notice the CRLF symbols in the text when there is a new line.
    1 point
  6. Of course! #AutoIt3Wrapper_UseX64=Y fixed the problem
    1 point
  7. Ok then try this ;Coded by UEZ 2013 -> This program requires AutoIt version 3.3.9.21 or higher! #AutoIt3Wrapper_Autoit3Dir=c:\Program Files (x86)\AutoIt3\Beta #include <GDIPlus.au3> #include <Memory.au3> _GDIPlus_Startup() Global $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\msoobe.jpg") Global $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global $hBitmap = _GDIPlus_ImageResize($hImage, 10, 7) Global $bImage = _GDIPlus_StreamImage2BinaryString($hBitmap) ConsoleWrite("Error: " & @error & @LF) MsgBox(0, "Binary", $bImage) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFilename = "Converted.jpg") ;coded by UEZ 2013 build 2013-09-14 Local $sImgCLSID, $tGUID, $tParams Switch $sFormat Case "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Local $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Case "PNG", "BMP", "GIF", "TIF" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Case Else Return SetError(1, 0, 0) EndSwitch Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) _GDIPlus_BitmapDispose($hBitmap) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) If $bSave Then Local $hFile = FileOpen($sFilename, 18) If @error Then Return SetError(6, 0, $bData) FileWrite($hFile, $bData) FileClose($hFile) EndIf Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString Requires AutoIt version 3.3.9.21 or higher! Br, UEZ
    1 point
×
×
  • Create New...