1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • Bit-Anzeiger

    • UEZ
    • 27. April 2013 um 01:09
    Zitat von minx

    OK, es geht noch kürzer :D

    ;)

    Gruß,
    UEZ

  • Bit-Anzeiger

    • UEZ
    • 27. April 2013 um 01:05

    Ich war mal so frei und habe dein Skript ein wenig gekürzt:

    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    $Form1_1 = GUICreate("Bit Anzeiger", 226, 83, 192, 114)
    $Label1 = GUICtrlCreateLabel("•", 112, 32, 8, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    Global $aButtons[8], $aBits[8], $iX = 16, $iVal, $i
    For $i = 0 To 7
    $aButtons[$i] = GUICtrlCreateButton("0", $iX + $i * 24, 16, 19, 25, $WS_GROUP)
    If $i = 3 Then $iX += 10
    Next
    $out = GUICtrlCreateInput("", 16, 48, 65, 21)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit]

    While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete()
    Exit
    Case $aButtons[0] To $aButtons[7]
    $iPos = $iMsg - $aButtons[0]
    $iBit = BitXOR($aBits[$iPos], 1)
    $aBits[$iPos] = $iBit
    GUICtrlSetData($aButtons[$iPos], $iBit)
    For $i = 7 To 0 Step - 1
    $iVal += 2 ^ (7 - $i) * $aBits[$i]
    Next
    GUICtrlSetData($out, $iVal)
    $iVal = 0
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Bildpunkte erkennen

    • UEZ
    • 16. April 2013 um 19:15
    Zitat von Scriptinator

    Hallo

    Nach dem Start einer Testumgebung (Server), muss ich händisch oftmals auf neuen VMs die IP, Hostname etc anpassen. Das möchte ich versuchen etwas zu vereinfachen. Außerdem das Installieren von Rollen auf Servern wäre recht nett. Brauche nur eben anfangs immer einen Startpunkt, falls das Fenster eben mal nicht mittig ist.
    Ist vielleicht nicht die einfachste Methode aber ich möchte es dennoch mal so versuchen.

    LG

    Normalerweise ist das nicht der Weg, um die VMs zu konfigurieren. Dafür gibt es PowerShell Scriptlets (vSphere PowerCLI).

    Gruß,
    UEZ

  • FotoSort

    • UEZ
    • 16. April 2013 um 16:20

    2 Dinge sind mir noch aufgefallen:

    1) die Funktion _DrawBgColor() ist so performanter

    [autoit]


    Func _DrawBgColor($iLeft, $iTop, $iWidth, $iHeight)
    Switch $iBgColor
    Case 0
    _GDIPlus_GraphicsFillRect($hGraphicBuff, $iPreviewLeft, $iPreviewTop, $iPreviewWidth, $iPreviewHeight, $hTexture)
    Case 1
    _GDIPlus_GraphicsFillRect($hGraphicBuff, $iPreviewLeft, $iPreviewTop, $iPreviewWidth, $iPreviewHeight, $ahBrush[3])
    Case 2
    _GDIPlus_GraphicsFillRect($hGraphicBuff, $iPreviewLeft, $iPreviewTop, $iPreviewWidth, $iPreviewHeight, $ahBrush[2])
    EndSwitch
    EndFunc

    [/autoit]

    2) Apropos Performance _ShowStatus() ist ziemlich langsam. Beim Blättern benötige die Funktion um die 400 ms. Da ist bestimmt noch Raum für Optimierungen. ;)

    Gruß,
    UEZ

  • FotoSort

    • UEZ
    • 16. April 2013 um 10:59

    Du könntest folgende Funktion nehmen, um das Pattern schneller zu erzeugen:

    [autoit]


    Func _DrawPattern($iLeft, $iTop, $iWidth, $iHeight)
    Local $iBrush = True, $iStep = 8
    _GDIPlus_GraphicsFillRect($hGraphicBuff, $iPreviewLeft, $iPreviewTop, $iPreviewWidth, $iPreviewHeight, $ahBrush[2])
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", 2 * $iStep, "int", 2 * $iStep, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0)
    Local $hBitmap = $aResult[6]
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iStep, $iStep, $ahBrush[0])
    _GDIPlus_GraphicsFillRect($hCtxt, $iStep, 0, $iStep, $iStep, $ahBrush[1])
    _GDIPlus_GraphicsFillRect($hCtxt, 0, $iStep, $iStep, $iStep, $ahBrush[1])
    _GDIPlus_GraphicsFillRect($hCtxt, $iStep, $iStep, $iStep, $iStep, $ahBrush[0])
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "handle", $hBitmap, "int", 0, "int*", 0)
    Local $hTexture = $aResult[3]
    _GDIPlus_GraphicsFillRect($hGraphicBuff, $iPreviewLeft, $iPreviewTop, $iPreviewWidth, $iPreviewHeight, $hTexture)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hTexture)
    _GDIPlus_BitmapDispose($hBitmap)
    EndFunc

    [/autoit]

    Ferner könntest du das Pattern einmal erstellen und nur die Bitmap kopieren, als immer das Pattern neu zu erstellen, denn es ändert sich nichts daran.

    Gruß,
    UEZ

  • Pipeline DLL - die einfachste Art der Prozess-Kommunikation

    • UEZ
    • 15. April 2013 um 10:13

    Zeigst du uns bitte auch noch den Source Code der DLL? :D

    Gruß,
    UEZ

  • FotoSort

    • UEZ
    • 14. April 2013 um 21:38

    Ganz nettes Tools :thumbup:

    Vielleicht könnte man den Hintergrund für transparente Bilder anders Darstellen als das schlichte schwarz, wie z.B. das klassische Schachbrettmuster.

    Gruß,
    UEZ

  • Bild mit 256 Farben erstellen

    • UEZ
    • 14. April 2013 um 12:21

    Man sollte hier zwischen 256 Farben und einer 8 Bit Bitmap differenzieren. Ein 24-bit Bild kann theoretisch auch nur 256 Farben beinhalten, aber ein 8 Bit Bild niemals mehr als 256 Farben.

    Hier 2 kleine Snippets.

    1) Benötigt kein GDI+ v1.1:

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    $sFile = FileOpenDialog("Bitte ein Bild selektieren", "", "Bilder (*.jpg;*.bmp;*.png)", 3)
    If @error Then Exit
    _GDIPlus_Startup()
    $hBitmap = _GDIPlus_BitmapCreateFromFile($sFile)
    $iWidth = _GDIPlus_ImageGetWidth($hBitmap)
    $iHeight = _GDIPlus_ImageGetHeight($hBitmap)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", $GDIP_PXF08INDEXED, "ptr", 0, "int*", 0)
    $hBmp8bit = $aResult[6]
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp8bit)
    _GDIPlus_GraphicsDrawImageRect($hCtxt, $hBitmap, 0, 0, $iWidth, $iHeight)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBitmap)
    $sOutputFile = @ScriptDir & "\Test_8bit.png"
    _GDIPlus_ImageSaveToFile($hBmp8bit, $sOutputFile)
    _GDIPlus_BitmapDispose($hBmp8bit)
    _GDIPlus_Shutdown()
    ShellExecute($sOutputFile)

    [/autoit]

    2) Benötigt GDI+ v1.1 (Vista oder höhere):

    Spoiler anzeigen
    [autoit]


    #include <ScreenCapture.au3>

    [/autoit] [autoit][/autoit] [autoit]

    If @OSBuild < 6000 Then Exit MsgBox(16, "Error", "GDI+ v1.1 needed -> Vista+ OS!", 10)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $GDIP_PXF32CMYK = 0x0000200F
    Global Const $GDIP_PXFMAX = 0x00000010

    [/autoit] [autoit][/autoit] [autoit]

    Global Enum $DitherTypeNone = 0, $DitherTypeSolid, $DitherTypeOrdered4x4, $DitherTypeOrdered8x8, $DitherTypeOrdered16x16, $DitherTypeOrdered91x91, $DitherTypeSpiral4x4, $DitherTypeSpiral8x8, $DitherTypeDualSpiral4x4, $DitherTypeDualSpiral8x8, $DitherTypeErrorDiffusion
    Global Enum $PaletteTypeCustom = 0, $PaletteTypeOptimal, $PaletteTypeFixedBW, $PaletteTypeFixedHalftone8, $PaletteTypeFixedHalftone27, $PaletteTypeFixedHalftone64, $PaletteTypeFixedHalftone125, $PaletteTypeFixedHalftone216, $PaletteTypeFixedHalftone252, $PaletteTypeFixedHalftone256

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    $iW = 300
    $iH = 300
    $hHBitmap = _ScreenCapture_Capture("", 0, 0, $iW, $iH) ;24 bit screen capture
    $hBitmap_screen = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) ;convert bitmap format

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $iColorCount = 1024
    $DitherType = $DitherTypeDualSpiral8x8
    $PaletteType = $PaletteTypeFixedHalftone256
    $PixelFormat = $GDIP_PXF08INDEXED

    [/autoit] [autoit][/autoit] [autoit]

    $tPalette = DllStructCreate("uint Flags; uint Count; uint Entries[" & $iColorCount & "];")
    DllStructSetData($tPalette, "Flags", $PaletteType)
    DllStructSetData($tPalette, "Count", $iColorCount)

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("> Init Palette: " & _GDIPlus_InitializePalette($tPalette, $PaletteType, 0, True, 0) & @CRLF)
    ConsoleWrite("! Error: " & @error & " Extended: " & @extended & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("> Convert: " & _GDIPlus_BitmapConvertFormat($hBitmap_screen, $PixelFormat, $DitherType, $PaletteType, $tPalette, 0) & @CRLF)
    ConsoleWrite("! Error: " & @error & " Extended: " & @extended & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_ImageSaveToFile($hBitmap_screen, @ScriptDir & "\Test.png")
    _WinAPI_DeleteObject($hHBitmap)
    _GDIPlus_BitmapDispose($hBitmap_screen)
    _GDIPlus_Shutdown()
    ShellExecute(@ScriptDir & "\Test.png")
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_BitmapConvertFormat($hBitmap, $iPixelFormat, $iDitherType, $iPaletteType, $tPalette, $falphaThresholdPercent = 0) ;http://msdn.microsoft.com/en-us/library/…6(v=VS.85).aspx
    Local $aResult = DllCall($ghGDIPDll, "bool", "GdipBitmapConvertFormat", "handle", $hBitmap, "long", $iPixelFormat, "long", $iDitherType, "long", $iPaletteType, "struct*", $tPalette, "float", $falphaThresholdPercent)
    If @error Then Return SetError(@error, @extended, -1)
    Return $aResult[0]
    EndFunc ;==>_GDIPlus_BitmapConvertFormat

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_InitializePalette($tPalette, $iPaletteType, $iOptimalColors = 0, $bUseTransparentColor = True, $hBitmap = 0) ;http://msdn.microsoft.com/en-us/library/…9(v=vs.85).aspx
    Local $aResult = DllCall($ghGDIPDll, "bool", "GdipInitializePalette", "struct*", $tPalette, "long", $iPaletteType, "int", $iOptimalColors, "bool", $bUseTransparentColor, "handle", $hBitmap)
    If @error Then Return SetError(@error, @extended, -1)
    Return $aResult[0]
    EndFunc ;==>_GDIPlus_InitializePalette

    [/autoit] [autoit][/autoit] [autoit]

    #cs
    http://msdn.microsoft.com/en-us/library/…6(v=vs.85).aspx
    VOID Example_ConvertFormat(HDC hdc)
    {
    Graphics graphics(hdc);
    Bitmap myBitmap(L"Photo.jpg");
    INT width = myBitmap.GetWidth();
    INT height = myBitmap.GetHeight();

    [/autoit] [autoit][/autoit] [autoit]

    graphics.DrawImage(&myBitmap, 20, 20, width, height);

    [/autoit] [autoit][/autoit] [autoit]

    // PaletteTypeFixedHalftone27 has 36 entries. A ColorPalette structure has
    // room for one entry, so space is allocated for an additional 35 entries.
    ColorPalette* pal = (ColorPalette*)malloc(sizeof(ColorPalette) + 35*sizeof(ARGB));
    pal->Count = 36;
    pal->Flags = 0;

    [/autoit] [autoit][/autoit] [autoit]

    Bitmap::InitializePalette(pal, PaletteTypeFixedHalftone27, 0, TRUE, NULL);

    [/autoit] [autoit][/autoit] [autoit]

    myBitmap.ConvertFormat(
    PixelFormat8bppIndexed,
    DitherTypeOrdered8x8,
    PaletteTypeFixedHalftone27,
    pal,
    0);

    [/autoit] [autoit][/autoit] [autoit]

    graphics.DrawImage(&myBitmap, width + 40, 20, width, height);

    [/autoit] [autoit][/autoit] [autoit]

    free(pal);
    }
    #ce

    [/autoit]

    Es gibt bestimmt noch andere Möglichkeiten 8 Bit Bilder zu erstellen (siehe Andy's kommentar).

    Gruß,
    UEZ

  • AutoIt-only 3D Engine. Mit Farb-Shading, Models aus Dateien, Rotation, Zoom, uvm.

    • UEZ
    • 12. April 2013 um 18:54

    Wenn du noch eine Texture drauf packen kannst, dann AAAAAAAAMMMMMMMMMMMMMMIIIIIIIIIIIIIIIIIIIIIIIIIIIIIGGGGGGGGGGGGGAAAAAAAAAAAAAAAA! :rock:

    Ansonsten top! :thumbup:

    Gruß,
    UEZ

  • Icons glätten?

    • UEZ
    • 11. April 2013 um 23:29

    GuiCtrlCreatePic() dient nur zum Anzeigen des GDI+ Bildes, um das Resultat zu vergleichen. Besser wäre es, das GDI+ Bild an den Control zu schicken, dann würde das Bild auch nicht gelöscht.

    Suche dir das Beste aus. ;)


    Gruß,
    UEZ

  • Icons glätten?

    • UEZ
    • 11. April 2013 um 22:37

    Hier ein Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    Opt("MustDeclareVars", 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global Const $STM_SETIMAGE = 0x0172

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGUI, $Msg, $Button, $Icon, $hIcon, $iPic, $hPic, $hGraphics, $Index = 0, $iBGColor = 0xF0F0F0
    Global $hIcon300x300 = _WinAPI_ShellExtractIcon("C:\Windows\system32\mobsync.exe", $Index, 300, 300)
    Global $hHBitmap256x256 = _WinAPI_GetFileIcon("C:\Windows\system32\mobsync.exe", $Index, 256, 256, $iBGColor)
    Global $hBitmapIcon256x256 = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap256x256)
    Global $hBitmapIcon300x300 = _GDIPlus_BitmapCreateFromScan0(300, 300)
    Global $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmapIcon300x300)
    _GDIPlus_GraphicsSetInterpolationMode($hContext, 7)
    _GDIPlus_GraphicsDrawImageRect($hContext, $hBitmapIcon256x256, 0, 0, 300, 300)
    _GDIPlus_GraphicsDispose($hContext)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $hGUI = GUICreate("MyGUI", 610, 300)
    GUISetBkColor($iBGColor)
    $Icon = GUICtrlCreateIcon("", 0, 0, 0, 300, 300)
    $hIcon = GUICtrlGetHandle(-1)
    $iPic = GUICtrlCreatePic("", 310,0, 300, 300)
    $hPic = GUICtrlGetHandle(-1)
    GUISetState()
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hPic)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmapIcon300x300, 0, 0, 300, 300)
    _WinAPI_DestroyIcon(_SendMessage($hIcon, $STM_SETIMAGE, 1, $hIcon300x300))

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case -3
    _GDIPlus_BitmapDispose($hBitmapIcon256x256)
    _GDIPlus_BitmapDispose($hBitmapIcon300x300)
    _WinAPI_DestroyIcon($hIcon300x300)
    _WinAPI_DeleteObject($hHBitmap256x256)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    ExitLoop
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _WinAPI_GetFileIcon($sFile, $iIndex = 0, $iW = 18, $iH = 18, $iColor = -1)
    Local $aRet, $hIcon, $hHBitmap
    Local $hDC, $hBackDC, $hBackSv

    [/autoit] [autoit][/autoit] [autoit]

    $aRet = DllCall("shell32.dll", "int", "SHExtractIconsW", "wstr", $sFile, "int", $iIndex, "int", $iW, "int", $iH, "ptr*", 0, "ptr*", 0, "int", 1, "int", 0)
    If @error Then Return SetError(6, @extended, 0)
    $hIcon = $aRet[5]

    [/autoit] [autoit][/autoit] [autoit]

    $hDC = _WinAPI_GetDC(0)
    $hBackDC = _WinAPI_CreateCompatibleDC($hDC)
    If $iColor = -1 Then $iColor = _WinAPI_GetSysColor($COLOR_MENU)
    $hHBitmap = _WinAPI_CreateSolidBitmap(0, $iColor, $iW, $iH)
    $hBackSv = _WinAPI_SelectObject($hBackDC, $hHBitmap)
    _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, $iW, $iH)
    _WinAPI_DestroyIcon($hIcon)

    [/autoit] [autoit][/autoit] [autoit]

    _WinAPI_SelectObject($hBackDC, $hBackSv)
    _WinAPI_ReleaseDC(0, $hDC)
    _WinAPI_DeleteDC($hBackDC)
    Return $hHBitmap
    EndFunc ;==>_GUICtrlMenu_CreateBitmap

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _WinAPI_ShellExtractIcon
    ; Description....: Extracts the icon with the specified dimension from the specified file.
    ; Syntax.........: _WinAPI_ShellExtractIcon ( $sIcon, $iIndex, $iWidth, $iHeight )
    ; Parameters.....: $sIcon - Path and name of the file from which the icon are to be extracted.
    ; $iIndex - The zero-based index of the icon to extract. If this value is a negative number, the function extracts
    ; the icon whose resource identifier is equal to the absolute value of $iIndex.
    ; $iWidth - Horizontal icon size wanted.
    ; $iHeight - Vertical icon size wanted.
    ; Return values..: Success - Handle to the extracted icon.
    ; Failure - 0 and sets the @error flag to non-zero.
    ; Author.........: Yashied
    ; Modified.......:
    ; Remarks........: If the icon with the specified dimension is not found in the file, it will choose the nearest appropriate icon
    ; and change to the specified dimension.
    ;
    ; When you are finished using the icon, destroy it using the _WinAPI_DestroyIcon() function.
    ; Related........:
    ; Link...........: @@MsdnLink@@ SHExtractIcons
    ; Example........: Yes
    ; ===============================================================================================================================
    Func _WinAPI_ShellExtractIcon($sIcon, $iIndex, $iWidth, $iHeight)
    Local $Ret = DllCall("shell32.dll", "int", "SHExtractIconsW", "wstr", $sIcon, "int", $iIndex, "int", $iWidth, "int", $iHeight, "ptr*", 0, "ptr*", 0, "int", 1, "int", 0)
    If (@error) Or (Not $Ret[0]) Or (Not $Ret[5]) Then
    Return SetError(1, 0, 0)
    EndIf
    Return $Ret[5]
    EndFunc ;==>_WinAPI_ShellExtractIcon

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_BitmapCreateFromScan0
    ; Description ...: Creates a Bitmap object based on an array of bytes along with size and format information
    ; Syntax.........: _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight[, $iStride = 0[, $iPixelFormat = 0x0026200A[, $pScan0 = 0]]])
    ; Parameters ....: $iWidth - The bitmap width, in pixels
    ; $iHeight - The bitmap height, in pixels
    ; $iStride - Integer that specifies the byte offset between the beginning of one scan line and the next. This
    ; +is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel)
    ; +multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four
    ; $iPixelFormat - Specifies the format of the pixel data. Can be one of the following:
    ; |$GDIP_PXF01INDEXED - 1 bpp, indexed
    ; |$GDIP_PXF04INDEXED - 4 bpp, indexed
    ; |$GDIP_PXF08INDEXED - 8 bpp, indexed
    ; |$GDIP_PXF16GRAYSCALE - 16 bpp, grayscale
    ; |$GDIP_PXF16RGB555 - 16 bpp; 5 bits for each RGB
    ; |$GDIP_PXF16RGB565 - 16 bpp; 5 bits red, 6 bits green, and 5 bits blue
    ; |$GDIP_PXF16ARGB1555 - 16 bpp; 1 bit for alpha and 5 bits for each RGB component
    ; |$GDIP_PXF24RGB - 24 bpp; 8 bits for each RGB
    ; |$GDIP_PXF32RGB - 32 bpp; 8 bits for each RGB. No alpha.
    ; |$GDIP_PXF32ARGB - 32 bpp; 8 bits for each RGB and alpha
    ; |$GDIP_PXF32PARGB - 32 bpp; 8 bits for each RGB and alpha, pre-mulitiplied
    ; $pScan0 - Pointer to an array of bytes that contains the pixel data. The caller is responsible for
    ; +allocating and freeing the block of memory pointed to by this parameter.
    ; Return values .: Success - Returns a handle to a new Bitmap object
    ; Failure - 0 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: After you are done with the object, call _GDIPlus_ImageDispose to release the object resources
    ; Related .......: _GDIPlus_ImageDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateBitmapFromScan0
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iStride = 0, $iPixelFormat = $GDIP_PXF32RGB, $pScan0 = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_BitmapCreateFromScan0

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetInterpolationMode
    ; Description ...: Sets the interpolation mode of a Graphics object
    ; Syntax.........: _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $iInterpolationMode - Interpolation mode:
    ; |0 - Default interpolation mode
    ; |1 - Low-quality mode
    ; |2 - High-quality mode
    ; |3 - Bilinear interpolation. No prefiltering is done
    ; |4 - Bicubic interpolation. No prefiltering is done
    ; |5 - Nearest-neighbor interpolation
    ; |6 - High-quality, bilinear interpolation. Prefiltering is performed to ensure high-quality shrinking
    ; |7 - High-quality, bicubic interpolation. Prefiltering is performed to ensure high-quality shrinking
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: The interpolation mode determines the algorithm that is used when images are scaled or rotated
    ; Related .......: _GDIPlus_GraphicsGetInterpolationMode
    ; Link ..........; @@MsdnLink@@ GdipSetInterpolationMode
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hGraphics, "int", $iInterpolationMode)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetInterpolationMode

    [/autoit]

    Kannst das Beispiel entsprechend ändern und die Bitmap in 24x24 erstellen und abspeichern. Die Quali sollte besser sein.

    Gruß,
    UEZ

  • Icons glätten?

    • UEZ
    • 11. April 2013 um 20:58

    Die Icons sind in 4, 8 und 32 Bit und in einer Auflösung von 16x16, 32x32, 48x48 und 256x256 abgespeichert. D.h. du solltest je nach Bedarf das entsprechende Icon dir heraussuchen.

    Einen Icon in 32x32 auf 256x256 zu skalieren, macht hier keinen Sinn.

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("Meine GUI Icons", 700, 300)

    [/autoit] [autoit][/autoit] [autoit]

    $icon = "C:\Windows\system32\mobsync.exe"

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateIcon($icon, 1, 20, 20, 16, 16)
    GUICtrlCreateIcon($icon, 1, 100, 20, 32, 32)
    GUICtrlCreateIcon($icon, 1, 200, 20, 48, 48)
    GUICtrlCreateIcon($icon, 1, 300, 20, 256, 256)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Local $msg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd

    [/autoit]

    Notfalls muss du das Icon mit GDI+ / WinAPI extrahieren und skalieren.

    Gruß,
    UEZ

  • textfile (komma separiert) in ein 2d Array einlesen

    • UEZ
    • 10. April 2013 um 15:54

    Probiere es mal damit: [ gelöst ] CSV-Datei in ein Array einlesen

    Gruß,
    UEZ

  • String packen ohne auf Festplatte auszulagern ?

    • UEZ
    • 8. April 2013 um 20:41

    Oder schaue hier mal rein: http://www.autoitscript.com/forum/topic/12…thm-collection/

    In dem Archiv gibt es ein Compression Ordner mit einigen Pack Algorithmen in Assembler geschrieben!

    Gruß,
    UEZ

  • MX-Au3 Lizenz v1.1

    • UEZ
    • 7. April 2013 um 21:29

    Das Ganze nun auch in Englisch! ;)

    Gruß,
    UEZ

  • Perforator v1.25 build 2015-06-30 beta

    • UEZ
    • 7. April 2013 um 10:56

    Neues und sehr wahrscheinlich letztes Update, es sein denn, es werden noch Bugs gefunden!

    Jetzt können auch GIF Animationen in der Haupt GUI abgespielt werden.

    Gruß,
    UEZ

  • Countdown und Progressbar

    • UEZ
    • 5. April 2013 um 20:41

    Ein bissle Mathe und dein Problem ist gelöst:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $fill = 15000

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("My GUI")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()
    $ID_1 = GUICtrlCreateButton("Countdown", 10, 25, 100)
    $ID_2 = GUICtrlCreateButton("Progress", 10, 55, 100)
    $progress = GUICtrlCreateProgress(70, 0, 200, 20)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $ID_1
    _sleep(30000)
    Case $ID_2
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _sleep($time)
    $tstart = TimerInit()
    $stime = $time
    Do
    GUICtrlCreateLabel("Zeit : " & $stime / 1000 & " sec", 0, 2)
    Sleep(1000)
    $stime -= 1000
    GUICtrlSetData($progress, Floor(100 * (($time - $stime) / $time)))
    Until TimerDiff($tstart) >= $time
    EndFunc ;==>_sleep

    [/autoit]

    Gruß,
    UEZ

  • RegEx Ausdruck

    • UEZ
    • 5. April 2013 um 16:38

    Probiere es mal damit:

    [autoit]


    $sLog = "2013-04-05 16:12:04 : Aufz. Start Mustermann AG" & @CRLF & _
    "2013-04-05 17:42:04 : Aufz. Start Mustermann AG" & @CRLF & _
    "2013-04-05 18:32:04 : Aufz. Start Mustermann AG" & @CRLF

    [/autoit][autoit][/autoit][autoit]

    $sLog_New = StringRegExpReplace($sLog, "(?m)(\d+\-\d+\-\d+)(\h)(\d+\:\d+\:\d+.*)", "\1" & @TAB & "\3")
    MsgBox(0, "", $sLog_New)

    [/autoit]

    Gruß,
    UEZ

  • a* A-Star Algorithmus (Grafik!!)

    • UEZ
    • 5. April 2013 um 09:53

    Da hatte jemand wohl eine lange Nacht gehabt! ;)


    Sehr schön geworden! :thumbup:

    Cool wäre es, wenn man schwarze Linien zeichnen könnte anstatt "mühselig" die Punkte zu setzen! Und ich kann das Ziel löschen.

    Gruß,
    UEZ

  • Ist AutoIt das richtige Programm für mich.

    • UEZ
    • 4. April 2013 um 10:15

    @David: ich weiß nicht, was du willst? Wenn dir AutoIt nicht zusagt, dann benutze AutoIt einfach nicht, denn es zwingt dich ja niemand dazu! Wenn andere AutoIt benutzen, dann ist das deren "Problem".

    Ich schlage vor, dass du solche Diskussionen hier lieber nicht anfängst, ansonsten wird der Thread dicht gemacht und der Bann Hammer wird geschwungen!

    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™