Jump to content

Myicq

Active Members
  • Posts

    334
  • Joined

  • Last visited

Community Answers

  1. Myicq's post in Testfile CJK - result is empty ? was marked as the answer   
    Thanks to trancexx  - you are a true Wizard.

    Func _ChrW($iCodePoint) ; By trancexx If $iCodePoint <= 0xFFFF Then Return ChrW($iCodePoint) ; ; uncomment if you need the @error value ; If $iCodePoint > 0x10FFFF Then Return SetError(1, 0, "") Local $tOut = DllStructCreate("word[2]") DllStructSetData($tOut, 1, BitShift($iCodePoint, 10) + 0xD7C0, 1) DllStructSetData($tOut, 1, BitAND($iCodePoint, 0x3FF) + 0xDC00, 2) Return BinaryToString(DllStructGetData(DllStructCreate("byte[4]", DllStructGetPtr($tOut)), 1), 2) EndFunc Would be nice to have support for codepoints above 0xFFFF natively. But for now, problem solved.
  2. Myicq's post in Convert raw image to imagefile was marked as the answer   
    I figured it out, thanks to a thread over at the German board. Thank yous should go to UEZ for the hard work on FreeImage...
    Commented code which I hope other newbies like me may enjoy.
    ; Showing a small example of freeimage with ; raw bitmap data as source ; ; help from http://www.autoitscript.com/forum/topic/95357-freeimage-library/page-4 ; and from https://autoit.de/index.php/Thread/30474-TGA-Bild-zu-einem-Jpg-oder-Bmp-Bild ; ; THANK YOU to UEZ for the invaluable UDFs and hard work. ; ================= #include "FreeImageFromMem.au3" _FreeImage_Initialise() ; will get a string 0xnnnnnn.. $file = FileOpen("myblob.raw", 16) $bmpdata = FileRead($file) ; create a struct for the image data. This could be done directly with FreeImage.. Local $tBinary = DllStructCreate("byte[" & BinaryLen($bmpdata) & "]") DllStructSetData($tBinary, 1, $bmpdata) ; fill it ; Get pointer to it Local $pPointer = DllStructGetPtr($tBinary) ; convert the image ; this conversion will be with correct data but NOT colors. All is black. $myImage = _FreeImage_ConvertFromRawBits($pPointer, 1280, 1024, 1280, 8, 0, 0, 1) ; Check that we have an 8 BPP image. We should.. Local $bpp = _freeImage_GetBPP($myImage) If $bpp = 8 Then ; read the palette (get a pointer to it) $palette = _freeimage_getpalette($myImage) ; make a struct to hold the data. 256 blocks of 3 byte. Local $tagPaletteComplete = "align 1" For $iCounter = 1 To 256 $tagPaletteComplete = $tagPaletteComplete & ";BYTE[3]" Next ; .. and put it in Local $structPalette = DllStructCreate($tagPaletteComplete, $palette) ; now modify palette with values For $i = 0 To 255 DllStructSetData($structPalette, $i, $i, 1) DllStructSetData($structPalette, $i, $i, 2) DllStructSetData($structPalette, $i, $i, 3) Next EndIf ; finally flip the image, as FreeImage is upside down... _FreeImage_FlipVertical($myImage) ; and save it to disc. _FreeImage_SaveU($FIF_BMP, $myImage, "myblob2.bmp") ; Done _FreeImage_Unload($myImage) _FreeImage_DeInitialise()
  3. Myicq's post in How to FileWriteLine() Chinese characters? was marked as the answer   
    Perhaps >setting encoding on source  ?
    And, use fileopen() with parameter for UTF8.

    $f = fileopen($pathName, 2 + 64)  ; overwrite, UTF8+BOM FileWriteLine($f, $LineArray[0])  
    Hint: FileWriteLine puts CRLF already.
  4. Myicq's post in Enable/Disable BHO in IE was marked as the answer   
    Would this help you in any way ?
    You can enable/disable BHOs by adding/removing a DWORD registry value called "Flags" with a value of 1 to this key: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\Settings\<BHO CLSID> From http://stackoverflow.com/questions/857563/activate-ie-add-ons-from-an-bho
    And / Or perhaps this:
    // BHOs HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects // IE toolbars HKLM\Software\Microsoft\Internet Explorer\Toolbar // IE extensions HKLM\Software\Microsoft\Internet Explorer\Extensions from http://stackoverflow.com/questions/413333/how-can-i-list-the-plugins-bhos-that-internet-explorer-uses-from-my-program
    Edit: Assuming you know how to manipulate Registry entries from AutoIT3, lots of examples around and in helpfile.
  5. Myicq's post in Perform the same code structure like what I create for excel macro was marked as the answer   
    You can do everything you can do with VBA, since the entire object space is available to other software including AutoIT.
    The hardest part, at least for me, is to find the right way to use the object model. But once you figure out how to go from VBA code objects to AutoIT, the rest pretty much gives itself away.
    My suggestion: make yourself a cheat sheet with a few notes on how to use functions, assign values and iterate over things.
    It would perhaps help if you would post some sample VBA code of what you wish to do ?
×
×
  • Create New...