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

  • einfacher AutoIt/GDI+ Leistungstest

    • UEZ
    • 3. Februar 2013 um 15:00

    Hier mein Resultat, gemessen auf meinem Schleppi:

    Spoiler anzeigen
    Code
    ########################################################################################################################
    #####################################################  Dateibeginn  ####################################################
    ########################################################################################################################
    
    
    
    
    
    
    Software-Informationen
    ------------------------------------------------------------------------------------------------------------------------
    Programmtitel:				AutoIt/GDI+ Benchmark
    Programmversion:			1.0.0.2
    Autor:					SBond
    Erstellungsdatum:			15.01.2013
    letztes Update:				17.01.2013
    Lizenz:					Freeware
    
    
    Informationen:				Mit diesem kleinen Programm ist es möglich, eine Leistungsanalyse von AutoIt und GDI+ durchzuführen, 
    					um diese anschließend vergleichen zu können.
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    allgemeine Benchmark-Informationen
    ------------------------------------------------------------------------------------------------------------------------
    Datum:					03.02.2013
    Zeit:					14:55:27
    
    
    Benchmark-Dauer:			134.18 s
    Grafik-breite				660
    Grafik-höhe:				300
    Grafik-Pixel:				198000
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Computer-Informationen
    ------------------------------------------------------------------------------------------------------------------------
    CPU-Architektur:			X64
    CPU-Clock:				2527 MHz
    CPU-Identifier:				Intel64 Family 6 Model 37 Stepping 5
    CPU-Name:				Intel(R) Core(TM) i5 CPU       M 540  @ 2.53GHz
    
    
    Betriebssystem:				WIN_7
    Build:					7601
    Service-Pack:				Service Pack 1
    Betriebssystem-Architektur:		X64
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 01/16:    von 1 bis 100.000.000 zählen... (dies kann einige Sekunden dauern)
    ------------------------------------------------------------------------------------------------------------------------
    gemessene Zeit:				10.3471 s
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 02/16:    immer eine Linie in den Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0096 s
    Plottfrequenz:				107.871 Hz
    Bildfrequenz (FPS):			0.163 Hz
    Plottzeit für einen Wert:		9.27 ms
    Plottzeit für ein Bild (660 Werte):	6118.2 ms
    
    
    
    
    
    
    Test 03/16:    immer eine Linie in den Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 1
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0005 s
    Plottfrequenz:				116.743 Hz
    Bildfrequenz (FPS):			0.177 Hz
    Plottzeit für einen Wert:		8.566 ms
    Plottzeit für ein Bild (660 Werte):	5653.56 ms
    
    
    
    
    
    
    Test 04/16:    immer eine Linie in den Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 2
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0006 s
    Plottfrequenz:				105.367 Hz
    Bildfrequenz (FPS):			0.16 Hz
    Plottzeit für einen Wert:		9.491 ms
    Plottzeit für ein Bild (660 Werte):	6264.06 ms
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 05/16:    immer eine Linie in den Frontbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0014 s
    Plottfrequenz:				2580.798 Hz
    Bildfrequenz (FPS):			3.91 Hz
    Plottzeit für einen Wert:		0.387 ms
    Plottzeit für ein Bild (660 Werte):	255.42 ms
    
    
    
    
    
    
    Test 06/16:    immer eine Linie in den Frontbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 1
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0001 s
    Plottfrequenz:				3322.083 Hz
    Bildfrequenz (FPS):			5.033 Hz
    Plottzeit für einen Wert:		0.301 ms
    Plottzeit für ein Bild (660 Werte):	198.66 ms
    
    
    
    
    
    
    Test 07/16:    immer eine Linie in den Frontbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 2
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0003 s
    Plottfrequenz:				2381.661 Hz
    Bildfrequenz (FPS):			3.609 Hz
    Plottzeit für einen Wert:		0.42 ms
    Plottzeit für ein Bild (660 Werte):	277.2 ms
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 08/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8 s
    Plottfrequenz:				19398.75 Hz
    Bildfrequenz (FPS):			29.392 Hz
    Plottzeit für einen Wert:		0.052 ms
    Plottzeit für ein Bild (660 Werte):	34.32 ms
    
    
    
    
    
    
    Test 09/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 1
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0003 s
    Plottfrequenz:				19469.27 Hz
    Bildfrequenz (FPS):			29.499 Hz
    Plottzeit für einen Wert:		0.051 ms
    Plottzeit für ein Bild (660 Werte):	33.66 ms
    
    
    
    
    
    
    Test 10/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 2
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8 s
    Plottfrequenz:				18790.625 Hz
    Bildfrequenz (FPS):			28.471 Hz
    Plottzeit für einen Wert:		0.053 ms
    Plottzeit für ein Bild (660 Werte):	34.98 ms
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 11/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0, Rauschsignal 1
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.005 s
    Plottfrequenz:				18468.457 Hz
    Bildfrequenz (FPS):			27.983 Hz
    Plottzeit für einen Wert:		0.054 ms
    Plottzeit für ein Bild (660 Werte):	35.64 ms
    
    
    
    
    
    
    Test 12/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0, Rauschsignal 2
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8.0047 s
    Plottfrequenz:				17974.44 Hz
    Bildfrequenz (FPS):			27.234 Hz
    Plottzeit für einen Wert:		0.056 ms
    Plottzeit für ein Bild (660 Werte):	36.96 ms
    
    
    
    
    
    
    Test 13/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0, Rauschsignal 3
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8 s
    Plottfrequenz:				18667.125 Hz
    Bildfrequenz (FPS):			28.284 Hz
    Plottzeit für einen Wert:		0.054 ms
    Plottzeit für ein Bild (660 Werte):	35.64 ms
    
    
    
    
    
    
    Test 14/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0, Rauschsignal 4
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8 s
    Plottfrequenz:				17707.25 Hz
    Bildfrequenz (FPS):			26.829 Hz
    Plottzeit für einen Wert:		0.056 ms
    Plottzeit für ein Bild (660 Werte):	36.96 ms
    
    
    
    
    
    
    Test 15/16:    nur den fertigen Backbuffer zeichnen...  Messdauer: 8 sek, Rendermodus: 0, Rauschsignal 5
    ------------------------------------------------------------------------------------------------------------------------
    eingestellte Messdauer:			8 s
    gemessene Zeit:				8 s
    Plottfrequenz:				12274.125 Hz
    Bildfrequenz (FPS):			18.597 Hz
    Plottzeit für einen Wert:		0.081 ms
    Plottzeit für ein Bild (660 Werte):	53.46 ms
    
    
    
    
    
    
    ########################################################################################################################
    
    
    
    
    
    
    Test 16/16:    nur den fertigen Backbuffer zeichnen... , Rendermodus: 0, Einzelpixel (dies kann einige Sekunden dauern)
    ------------------------------------------------------------------------------------------------------------------------
    gemessene Zeit:				11.7803 s
    
    
    
    
    
    
    ########################################################################################################################
    ######################################################  Dateiende  #####################################################
    ########################################################################################################################
    Alles anzeigen


    SBond: Physik Student?

    Gruß,
    UEZ

  • GDI+ Show Histogram v0.97 beta build 2013-02-05

    • UEZ
    • 2. Februar 2013 um 09:09

    War von mir falsch ausgedrückt! Meinte eher wie ich die Werte interpretieren soll. Wann ist ein Bild ein gut aufgenommenes Bild? Etc.

    Apropos Schieberegler. Wer Lust und Zeit hat kann ja hierzu eine GUI mit Schiebereglern bauen.

    Spoiler anzeigen
    [autoit]


    ;http://msdn.microsoft.com/en-us/library/…6(v=vs.85).aspx
    #include <Array.au3>
    #include <GDIplus.au3>

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

    Global Const $GDIP_BLUREFFECT = "{633C80A4-1843-482b-9EF2-BE2834C5FDD4}"
    Global Const $GDIP_BRIGHTNESSCONTRASTEFFECT = "{D3A1DBE1-8EC4-4c17-9F4C-EA97AD1C343D}"
    Global Const $GDIP_COLORBALANCEEFFECT = "{537E597D-251E-48da-9664-29CA496B70F8}"
    Global Const $GDIP_COLORCURVEEFFECT = "{DD6A0022-58E4-4a67-9D9B-D48EB881A53D}"
    Global Const $GDIP_COLORLUTEFFECT = "{A7CE72A9-0F7F-40d7-B3CC-D0C02D5C3212}"
    Global Const $GDIP_COLORMATRIXEFFECT = "{718F2615-7933-40e3-A511-5F68FE14DD74}"
    Global Const $GDIP_HUESATURATIONLIGHTNESSEFFECT = "{8B2DD6C3-EB07-4d87-A5F0-7108E26A9C5F}"
    Global Const $GDIP_LEVELSEFFECT = "{99C354EC-2A31-4f3a-8C34-17A803B33A25}"
    Global Const $GDIP_REDEYECORRECTIONEFFECT = "{74D29D05-69A4-4266-9549-3CC52836B632}"
    Global Const $GDIP_TINTEFFECT = "{1077AF00-2848-4441-9489-44AD4C2D7A2C}"
    Global Const $GDIP_SHARPENEFFECT = "{63CBF3EE-C526-402c-8F71-62C540BF5142}"

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

    _GDIPlus11_Startup()
    If @error Then Exit MsgBox(0x40010, "Error", "GDI+ Effect Collection can run on operating systems Vista or newer only!")

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

    Global $file = FileOpenDialog("Select Image", "", "Images (*.jpg;*.png;*.bmp;*.gif)")
    If @error Then Exit _GDIPlus_Shutdown()

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

    Global $hBitmap = _GDIPlus_BitmapCreateFromFile($file)
    Global $iW = _GDIPlus_ImageGetWidth($hBitmap)
    Global $iH = _GDIPlus_ImageGetHeight($hBitmap)
    Global $hGUI = GUICreate("GDI+ v1.1 Effect Collection by UEZ 2013", $iW, $iH)
    GUISetState()

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

    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)

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

    Global $hEffect

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

    Global $tRECTF = DllStructCreate($tagGDIPRECTF)
    DllStructSetData($tRECTF, "X", 0)
    DllStructSetData($tRECTF, "Y", 0)
    DllStructSetData($tRECTF, "Width", $iW)
    DllStructSetData($tRECTF, "Height", $iH)
    Global $pRECTF = DllStructGetPtr($tRECTF)

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

    ;Color LUT
    Global Const $tagCOLORLUTPARAMS = "byte ColorChannelLUTB[256];byte ColorChannelLUTG[256];byte ColorChannelLUTR[256];byte ColorChannelLUTA[256]"
    Global $tColorLUT = DllStructCreate($tagCOLORLUTPARAMS)
    For $i = 192 To 256
    DllStructSetData($tColorLUT, "ColorChannelLUTR", 0xA0, $i)
    DllStructSetData($tColorLUT, "ColorChannelLUTG", 0xB0, $i)
    DllStructSetData($tColorLUT, "ColorChannelLUTB", 0xC0, $i)
    Next
    $hEffect = _GDIPlus_ColorLUT($tColorLUT)
    ConsoleWrite("Color LUT" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;~ ;Blur
    Global Const $tagBLURPARAMS = "float radius;bool expandEdge" ;0-255; False/True
    Global $tBlur = DllStructCreate($tagBLURPARAMS)
    $hEffect = _GDIPlus_Blur($tBlur, 10)
    ConsoleWrite("Blur" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Brightness Contrast
    Global Const $tagBRIGHTNESSCONTRASTPARAMS = "int brightnessLevel;int contrastLevel" ;-255-255; -100-100
    Global $tBrightnessContrast = DllStructCreate($tagBRIGHTNESSCONTRASTPARAMS)
    $hEffect = _GDIPlus_BrightnessContrast($tBrightnessContrast, -60, 90)
    ConsoleWrite("Brightness Contrast" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Color Balance
    Global Const $tagCOLORBALANCEPARAMS = "int cyanRed;int magentaGreen;int yellowBlue" ;-100-100; -100-100; -100-100
    Global $tColorBalance = DllStructCreate($tagCOLORBALANCEPARAMS)
    $hEffect = _GDIPlus_ColorBalance($tColorBalance, 60, -50, 20)
    ConsoleWrite("Color Balance" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Color Curve
    Global Enum $iAdjustExposure = 0, $iAdjustDensity, $iAdjustContrast, $iAdjustHighlight, $iAdjustShadow, _ ;http://msdn.microsoft.com/en-us/library/…8(v=vs.85).aspx
    $iAdjustMidtone, $iAdjustWhiteSaturation, $iAdjustBlackSaturation
    Global Enum $iCurveChannelAll = 0, $iCurveChannelRed, $iCurveChannelGreen, $iCurveChannelBlue ;http://msdn.microsoft.com/en-us/library/…0(v=vs.85).aspx
    Global Const $tagCOLORCURVEEFFECTPARAMS = "int type;int channel;int value"
    Global $tColorCurve = DllStructCreate($tagCOLORCURVEEFFECTPARAMS)
    $hEffect = _GDIPlus_ColorCurve($tColorCurve, $iAdjustHighlight, $iCurveChannelAll, 90)
    ConsoleWrite("Color Curve" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Color Matrix
    Global Const $tagGDIPCOLORMATRIXPARAMS = "float m[25];"
    Global $tColorMatrix = DllStructCreate($tagGDIPCOLORMATRIXPARAMS)
    Global $fRed = 0.66, $fGreen = 0.5, $fBlue = 0.5, $fAlpha = 1
    $hEffect = _GDIPlus_ColorMatrix($tColorMatrix, $fRed, $fGreen, $fBlue, $fAlpha)
    ConsoleWrite("Color Matrix" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Hue Saturation Lightness
    Global Const $tagHUESATURATIONLIGHTNESSPARAMS = "int hueLevel;int saturationLevel;int lightnessLevel" ;-180-180; -100-100; -100-100
    Global $tHueSaturationLightness = DllStructCreate($tagHUESATURATIONLIGHTNESSPARAMS)
    $hEffect = _GDIPlus_HueSaturationLightness($tHueSaturationLightness, 90, -50, 20)
    ConsoleWrite("Hue Saturation Lightness" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Levels
    Global Const $tagLEVELSPARAMS = "int highlight;int midtone;int shadow" ;0-100; -100-100; 0-100
    Global $tLevels = DllStructCreate($tagLEVELSPARAMS)
    $hEffect = _GDIPlus_Levels($tLevels, 60, -50, 20)
    ConsoleWrite("Levels" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Sharpen
    Global Const $tagSHARPENPARAMS = "float radius;float amount" ;0-255; 0-100
    Global $tSharpen = DllStructCreate($tagSHARPENPARAMS)
    $hEffect = _GDIPlus_Sharpen($tSharpen, 60, 90)
    ConsoleWrite("Sharpen" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;Tint
    Global Const $tagTINTPARAMS = "int hue;int amount" ;-180-180; -100-100
    Global $tTint = DllStructCreate($tagTINTPARAMS)
    $hEffect = _GDIPlus_Tint($tTint, 60, 40)
    ConsoleWrite("Tint" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    Sleep(3000)

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

    ;~ ;Red Eye v1
    ;~ Global $tRECT1 = DllStructCreate("long left;long top;long right;long buttom")
    ;~ DllStructSetData($tRECT1, "left", 55)
    ;~ DllStructSetData($tRECT1, "top", 69)
    ;~ DllStructSetData($tRECT1, "right", 68)
    ;~ DllStructSetData($tRECT1, "buttom", 81)
    ;~ Global $pRECT1 = DllStructGetPtr($tRECT1)

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

    ;~ Global $tRECT2 = DllStructCreate("long left;long top;long right;long buttom")
    ;~ DllStructSetData($tRECT2, "left", 159)
    ;~ DllStructSetData($tRECT2, "top", 68)
    ;~ DllStructSetData($tRECT2, "right", 172)
    ;~ DllStructSetData($tRECT2, "buttom", 81)
    ;~ Global $pRECT2 = DllStructGetPtr($tRECT2)

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

    ;~ Global Const $tagREDEYECORRECTIONPARAMS = "uint numberOfAreas;int areas[1]"
    ;~ Global $tRedEye = DllStructCreate($tagREDEYECORRECTIONPARAMS)
    ;~ Global Const $pRedEye = DllStructGetPtr($tRedEye)
    ;~ DllStructSetData($tRedEye, "numberOfAreas", 1)
    ;~ DllStructSetData($tRedEye, "areas", $tRECT1, 1)
    ;~ $hEffect = _GDIPlus_EffectCreate($GDIP_REDEYECORRECTIONEFFECT)
    ;~ ConsoleWrite(_GDIPlus_EffectsSetParameters($hEffect, $pRedEye) & " / " & @error & @LF)

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

    ;~ ;Red Eye v2
    ;~ Global $aByteRECT = _ByteArray_Create("struct;long Left;long Top;long Right;long Bottom;endstruct", 2)
    ;~ _WinAPI_SetRect($aByteRECT[1], 55, 69, 68, 81)
    ;~ _WinAPI_SetRect($aByteRECT[2], 159, 68, 172, 81)

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

    ;~ Global Const $tagREDEYECORRECTIONPARAMS = "uint numberOfAreas;ptr areas"
    ;~ Global $tRedEye = DllStructCreate($tagREDEYECORRECTIONPARAMS)
    ;~ Global Const $pRedEye = DllStructGetPtr($tRedEye)
    ;~ DllStructSetData($tRedEye, "numberOfAreas", 2) ; Anzahl der übergebenen RECT
    ;~ DllStructSetData($tRedEye, "areas", DllStructGetPtr($aByteRECT))
    ;~ $hEffect = _GDIPlus_EffectCreate($GDIP_REDEYECORRECTIONEFFECT)
    ;~ ConsoleWrite(_GDIPlus_EffectsSetParameters($hEffect, $pRedEye) & @LF)

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

    ;~ ConsoleWrite("Red Eye" & @CRLF)
    ;~ _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    ;~ _GDIPlus_EffectDispose($hEffect)

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

    ;~ $hBitmap_Effect = _GDIPlus_BitmapCreateApplyEffect($hBitmap, $hEffect)
    ;~ _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Effect, 0, 0)

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

    $tBlur = 0
    $tTint = 0
    $tColorCurve = 0
    $tSharpen = 0
    $tColorMatrix = 0
    $tBrightnessContrast = 0
    $tLevels = 0
    $tColorBalance = 0
    $tColorColorChannelLUT = 0
    $tRedEye = 0
    $tRECTF1 = 0
    $tRECTF2 = 0
    $tRECTF = 0

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

    MsgBox(0, "", "Done")

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

    Do
    Until GUIGetMsg() = -3

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

    _GDIPlus_BitmapDispose($hBitmap)
    ;~ _GDIPlus_BitmapDispose($hBitmap_Effect)
    _GDIPlus_GraphicsDispose($hGraphics)

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

    _GDIPlus_Shutdown()

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

    Exit

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

    #cs
    ;Red Eye
    Global $aByteRECT = _ByteArray_Create("struct;long Left;long Top;long Right;long Bottom;endstruct", 2)
    _WinAPI_SetRect($aByteRECT[1], 55, 69, 68, 81)
    _WinAPI_SetRect($aByteRECT[2], 159, 68, 172, 81)

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

    Global Const $tagREDEYECORRECTIONPARAMS = "uint numberOfAreas;ptr areas"
    Global $tRedEye = DllStructCreate($tagREDEYECORRECTIONPARAMS)
    Global Const $pRedEye = DllStructGetPtr($tRedEye)
    DllStructSetData($tRedEye, "numberOfAreas", 2) ; Anzahl der übergebenen RECT
    DllStructSetData($tRedEye, "areas", DllStructGetPtr($aByteRECT))
    $hEffect = _GDIPlus_EffectCreate($GDIP_REDEYECORRECTIONEFFECT)
    ConsoleWrite(_GDIPlus_EffectsSetParameters($hEffect, $pRedEye) & @LF)

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

    ConsoleWrite("Red Eye" & @CRLF)
    _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect)
    _GDIPlus_EffectDispose($hEffect)
    #ce

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

    ;===============================================================================
    ; Function Name: _ByteArrayCreate($sSTRUCT, $iELEMENTS=2)
    ; Description: Erstellt eine Bytearray-Struktur
    ; $aBYTE[0] enthält die Variable, die an einen Dll-Aufruf zu übergeben wäre
    ; Parameter(s): $sSTRUCT String der Struktur
    ; $iELEMENTS Anzahl der Elemente des Bytearray
    ; Return Value(s): das erstellte Bytearray
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;===============================================================================
    Func _ByteArray_Create($sSTRUCT, $iELEMENTS = 2)
    Local $SIZE = DllStructGetSize(DllStructCreate($sSTRUCT, 1))
    Local $aBYTE[$iELEMENTS + 1]
    $aBYTE[0] = DllStructCreate('byte[' & $SIZE * $iELEMENTS & "]")
    Local $Ptr = DllStructGetPtr($aBYTE[0])
    For $i = 0 To $iELEMENTS - 1
    $aBYTE[$i + 1] = DllStructCreate($sSTRUCT, $Ptr + $i * $SIZE)
    Next
    Return $aBYTE
    EndFunc ;==>_ByteArray_Create

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

    ;===============================================================================
    ; Function Name: _WinAPI_SetRect(ByRef $tRECT, $X1, $Y1, $X2, $Y2)
    ; Description: Befüllt eine RECT-Struktur in einem Aufruf mit Werten
    ; Parameter(s): $tRECT RECT-Struktur
    ; $X1, $Y1, $X2, $Y2 Werte des Rectangle
    ; Return Value(s): Erfolg > 0
    ; Fehler 0 set @error
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;===============================================================================
    Func _WinAPI_SetRect(ByRef $tRECT, $X1, $Y1, $X2, $Y2)
    Local $ret = DllCall("user32", 'long', 'SetRect', 'ptr', DllStructGetPtr($tRECT), 'long', $X1, 'long', $Y1, 'long', $X2, 'long', $Y2)
    If @error > 0 Then Return SetError(1, @error, 0)
    Return $ret[0]
    EndFunc ;==>_WinAPI_SetRect

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

    Func _GDIPlus_Blur($tBlur, $fRadius, $bExpandEdge = False)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tBlur, "radius", $fRadius)
    DllStructSetData($tBlur, "expandEdge", $bExpandEdge)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_BLUREFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tBlur))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_BrightnessContrast($tBrightnessContrast, $iBrightnessLevel, $iContrastLevel)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tBrightnessContrast, "brightnessLevel", $iBrightnessLevel)
    DllStructSetData($tBrightnessContrast, "contrastLevel", $iContrastLevel)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_BRIGHTNESSCONTRASTEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tBrightnessContrast))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_ColorBalance($tColorBalance, $iCyanRed, $iMagentaGreen, $iYellowBlue)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tColorBalance, "cyanRed", $iCyanRed)
    DllStructSetData($tColorBalance, "magentaGreen", $iMagentaGreen)
    DllStructSetData($tColorBalance, "yellowBlue", $iYellowBlue)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_COLORBALANCEEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tColorBalance))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_ColorCurve($tColorCurve, $iType, $iChannel, $iValue)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tColorCurve, "type", $iType)
    DllStructSetData($tColorCurve, "channel", $iChannel)
    DllStructSetData($tColorCurve, "value", $iValue)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_COLORCURVEEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tColorCurve))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_ColorLUT($tColorLUT)
    If Not IsDllStruct($tColorLUT) Then Return SetError(1, @error, 0)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_COLORLUTEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tColorLUT))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_ColorMatrix($tColorMatrix, $fRed, $fGreen, $fBlue, $fAlpha)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tColorMatrix, "m", $fRed, 1)
    DllStructSetData($tColorMatrix, "m", $fGreen, 7)
    DllStructSetData($tColorMatrix, "m", $fBlue, 13)
    DllStructSetData($tColorMatrix, "m", $fAlpha, 19)
    DllStructSetData($tColorMatrix, "m", 1, 25) ;the element in the fifth row and fifth column of a 5×5 homogeneous matrix must be 1, and all of the other elements in the fifth column must be 0
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_COLORMATRIXEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tColorMatrix))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_HueSaturationLightness($tHueSaturationLightness, $iHueLevel, $iSaturationLevel, $iLightnessLevel)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tHueSaturationLightness, "hueLevel", $iHueLevel)
    DllStructSetData($tHueSaturationLightness, "saturationLevel", $iSaturationLevel)
    DllStructSetData($tHueSaturationLightness, "lightnessLevel", $iLightnessLevel)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_HUESATURATIONLIGHTNESSEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tHueSaturationLightness))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_Levels($tLevels, $iHighlight, $iMidtone, $iShadow)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tLevels, "highlight", 60)
    DllStructSetData($tLevels, "midtone", -50)
    DllStructSetData($tLevels, "shadow", 20)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_LEVELSEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tLevels))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_Sharpen($tSharpen, $fRadius, $fAmount)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tSharpen, "radius", $fRadius)
    DllStructSetData($tSharpen, "amount", $fAmount)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_SHARPENEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tSharpen))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_Tint($tTint, $iHue, $iAmount)
    If Not IsDllStruct($tBlur) Then Return SetError(1, @error, 0)
    DllStructSetData($tTint, "hue", $iHue)
    DllStructSetData($tTint, "amount", $iAmount)
    Local $hEffect = _GDIPlus_EffectCreate($GDIP_TINTEFFECT)
    If @error Then Return SetError(2, @error, 0)
    _GDIPlus_EffectsSetParameters($hEffect, DllStructGetPtr($tTint))
    If @error Then Return SetError(3, @error, 0)
    Return $hEffect
    EndFunc

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

    Func _GDIPlus_EffectCreate($sEffectGUID, $pEffect = 0)
    Local $iI, $tGUID, $pGUID, $tElem, $aElem[4], $aResult
    $tGUID = _WinAPI_GUIDFromString($sEffectGUID)
    $pGUID = DllStructGetPtr($tGUID)
    $tElem = DllStructCreate("uint[4]", $pGUID)
    For $iI = 1 To 4
    $aElem[$iI - 1] = DllStructGetData($tElem, 1, $iI)
    Next
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateEffect", "uint", $aElem[0], "uint", $aElem[1], "uint", $aElem[2], "uint", $aElem[3], "uint*", $pEffect)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[5])
    EndFunc ;==>_GDIPlus_EffectCreate

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

    Func _GDIPlus_EffectsSetParameters($hEffectObject, $pEffectParameters)
    Local $aSize = DllCall($ghGDIPDll, "uint", "GdipGetEffectParameterSize", "handle", $hEffectObject, "uint*", 0)
    Local $iSize = $aSize[2]
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetEffectParameters", "handle", $hEffectObject, "ptr", $pEffectParameters, "uint", $iSize)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[3])
    EndFunc ;==>_GDIPlus_EffectsSetParameters

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

    Func _GDIPlus_BitmapCreateApplyEffect($hBitmap, $hEffect, $pROI = 0, $pOutRect = 0, $hBmpOutput = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapCreateApplyEffect", _
    "ptr*", $hBitmap, _
    "int", 1, _
    "handle", $hEffect, _
    "ptr", $pROI, _
    "ptr", $pOutRect, _
    "int*", $hBmpOutput, _
    "int", 0, "ptr*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[6])
    EndFunc ;==>_GDIPlus_BitmapCreateApplyEffect

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

    Func _GDIPlus_EffectDispose($hEffect)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeleteEffect", "handle", $hEffect)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_EffectDispose

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

    Func _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect, $pROI = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapApplyEffect", "handle", $hBitmap, "handle", $hEffect, "ptr", $pROI, "int", 0, "ptr*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_BitmapApplyEffect

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

    Func _GDIPlus_DrawImageFX($hGraphics, $hBitmap, $pRECTF, $hEffect, $hMatrix = 0, $ImgAttributes = 0, $iUnit = 2)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipDrawImageFX", "handle", $hGraphics, _
    "handle", $hBitmap, _
    "ptr", $pRECTF, _
    "handle", $hMatrix, _
    "handle", $hEffect, _
    "ptr", $ImgAttributes, _
    "uint", $iUnit)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_DrawImageFX

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

    Func _GDIPlus11_Startup() ;code by Authenticity - modified by UEZ
    Local $pInput, $tInput, $pToken, $tToken, $aResult, $os

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

    $giGDIPRef += 1
    If $giGDIPRef > 1 Then Return True

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

    Switch @OSVersion
    Case "WIN_VISTA", "WIN_2008"
    $ghGDIPDll = DllOpen(@WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll")
    Case "WIN_2008R2", "WIN_7", "WIN_8"
    $ghGDIPDll = DllOpen(@SystemDir & "\gdiplus.dll")
    Case Else
    Return SetError(1)
    EndSwitch
    ;~ _WinAPI_Check("_GDIPlus_Startup (GDIPlus.dll not found)", @error, False)

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

    $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
    $pInput = DllStructGetPtr($tInput)
    $tToken = DllStructCreate("int Data")
    $pToken = DllStructGetPtr($tToken)
    DllStructSetData($tInput, "Version", 1)
    $aResult = DllCall($ghGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    $giGDIPToken = DllStructGetData($tToken, "Data")
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus11_Startup

    [/autoit]

    Weiß jemand, wie man Red Eye initialisieren kann, so dass auch dieser Effekt anwendbar ist (auskommentierter Bereich)? MSDN Link dazu: RedEyeCorrectionParams Structure

    Gruß,
    UEZ

  • GDI+ Show Histogram v0.97 beta build 2013-02-05

    • UEZ
    • 31. Januar 2013 um 23:42

    Hier ein kleines Tool zum Anzeigen eines Histogrammes von Bildern.

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_Compile_Both=y
    #AutoIt3Wrapper_Res_Field=CompanyName|UEZ Software Development
    #AutoIt3Wrapper_Res_Field=ProductName|GDI+ Show Histogram
    #AutoIt3Wrapper_Res_Field=ProductVersion|%AutoItVer%
    #AutoIt3Wrapper_Res_Fileversion=0.9.7.0
    #AutoIt3Wrapper_Res_Field=Build|2013-02-05
    #AutoIt3Wrapper_Res_LegalCopyright=UEZ Software Development
    #AutoIt3Wrapper_Res_Language=1033
    #AutoIt3Wrapper_Res_Field=URL|http://www.autoitscript.com/forum/index.php?showtopic=147777
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/om /sv /sf /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--best --lzma

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

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

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

    Opt("MustDeclareVars", 1)
    Opt("MouseCoordMode", 2)

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

    _GDIPlus11_Startup()
    If @error Then Exit MsgBox(0x40010, "Error", "GDI+ Show Histogram can run on operating systems Vista or newer only!")

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

    Global Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]")
    Global Const $aFullScreen = WinGetPos($hFullScreen)

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

    Global Enum $HistogramFormatARGB, $HistogramFormatPARGB, $HistogramFormatRGB, $HistogramFormatGray, _ ;http://msdn.microsoft.com/en-us/library/…9(v=vs.85).aspx
    $HistogramFormatB, $HistogramFormatG, $HistogramFormatR, $HistogramFormatA

    [/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]

    ;http://msdn.microsoft.com/en-us/library/…6(v=vs.85).aspx
    Global Const $ImageFlagsNone = 0
    Global Const $ImageFlagsScalable = 0x0001
    Global Const $ImageFlagsHasAlpha = 0x0002
    Global Const $ImageFlagsHasTranslucent = 0x0004
    Global Const $ImageFlagsPartiallyScalable = 0x0008
    Global Const $ImageFlagsColorSpaceRGB = 0x0010
    Global Const $ImageFlagsColorSpaceCMYK = 0x0020
    Global Const $ImageFlagsColorSpaceGRAY = 0x0040
    Global Const $ImageFlagsColorSpaceYCBCR = 0x0080
    Global Const $ImageFlagsColorSpaceYCCK = 0x0100
    Global Const $ImageFlagsHasRealDPI = 0x1000
    Global Const $ImageFlagsHasRealPixelSize = 0x2000
    Global Const $ImageFlagsReadOnly = 0x00010000
    Global Const $ImageFlagsCaching = 0x00020000

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

    Global $tStructChannel0 = DllStructCreate("uint channel0[256]")
    Global $pStructChannel0 = DllStructGetPtr($tStructChannel0)
    Global $tStructChannel1 = DllStructCreate("uint channel1[256]")
    Global $pStructChannel1 = DllStructGetPtr($tStructChannel1)
    Global $tStructChannel2 = DllStructCreate("uint channel2[256]")
    Global $pStructChannel2 = DllStructGetPtr($tStructChannel2)
    Global $tStructChannel3 = DllStructCreate("uint channel3[256]")
    Global $pStructChannel3 = DllStructGetPtr($tStructChannel3)

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

    Global $s, $sFile, $hImage, $bImgLoaded = False, $aLuminosity[257], $aCRGB[257]
    Global Const $STM_SETIMAGE = 0x0172, $iLineJoinBevel = 1, $frY = 0.299, $fgY = 0.587, $fbY = 0.114

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

    Global Const $hGUI = GUICreate("GDI+ Show Histogram v0.97 beta by UEZ build 2013-02-05", 468, 310, -1, -1, Default, Default)
    Global Const $sLabel_Titel_Txt = "GDI+ Show Histogram"
    Global Const $iPosX_Label = 20, $iPosY_Label = 12
    Global Const $iLabel_Titel_Shadow = GUICtrlCreateLabel($sLabel_Titel_Txt, $iPosX_Label, $iPosY_Label, 429, 57)
    GUICtrlSetFont(-1, 30, 400, 0, "Comic Sans MS", 4)
    GUICtrlSetColor(-1, 0xC0C0D8)
    Global Const $iLabel_Titel = GUICtrlCreateLabel($sLabel_Titel_Txt, $iPosX_Label - 4, $iPosY_Label - 4, 429, 57)
    GUICtrlSetFont(-1, 30, 400, 0, "Comic Sans MS", 4)
    GUICtrlSetColor(-1, 0x0000C0)
    GUICtrlSetBkColor(-1, -2)
    Global Const $iPic_Histogram = GUICtrlCreatePic("", 20, 90, 255, 127, -1, $WS_EX_STATICEDGE)
    GUICtrlSetCursor(-1, 14)
    Global Const $iPic_ColorGradient = GUICtrlCreatePic("", 20, 220, 255, 24, -1, $WS_EX_STATICEDGE)

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

    Global Const $iGroup = GUICtrlCreateGroup("Channel", 290, 84, 160, 164)
    Global Const $iRadio_L = GUICtrlCreateRadio("Luminosit&y (gray)", 300, 100, 110, 20)
    GUICtrlSetTip(-1, $frY & "*R, " & $fgY & "*G, " & $fbY & "*B")
    GUICtrlSetState($iRadio_L, $GUI_CHECKED)
    Global Const $iRadio_C = GUICtrlCreateRadio("&cRGB", 300, 130, 60, 20)
    GUICtrlSetTip(-1, "Combined average of RGB values")
    Global Const $iRadio_R = GUICtrlCreateRadio("&Red", 300, 160, 60, 20)
    Global Const $iRadio_G = GUICtrlCreateRadio("&Green", 300, 190, 60, 20)
    Global Const $iRadio_B = GUICtrlCreateRadio("&Blue", 300, 220, 60, 20)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Global Const $iButton_Save = GUICtrlCreateButton("&Save", 209, 265, 70, 30)
    GUICtrlSetTip(-1, "Click button to save all histogram images")
    GUICtrlSetState(-1, $GUI_DISABLE)
    Global Const $iButton_Load = GUICtrlCreateButton("&Load", 290, 265, 70, 30)
    GUICtrlSetTip(-1, "Click button to load an image")
    Global Const $iButton_Exit = GUICtrlCreateButton("E&xit", 390, 265, 60, 30)

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

    Global $sLabelCredit_Txt = "coded by UEZ'13"
    Global $aLabelCredit_Pos[StringLen($sLabelCredit_Txt)][4], $u, $iFS = 6.5, $iY = 280
    For $u = 0 To UBound($aLabelCredit_Pos) - 1
    $aLabelCredit_Pos[$u][0] = StringMid($sLabelCredit_Txt, $u + 1, 1)
    $aLabelCredit_Pos[$u][1] = 20 + $u * ($iFS - 0.25)
    $aLabelCredit_Pos[$u][2] = $iY
    $aLabelCredit_Pos[$u][3] = GUICtrlCreateLabel($aLabelCredit_Pos[$u][0], $aLabelCredit_Pos[$u][1], $aLabelCredit_Pos[$u][2], $iFS, $iFS * 1.8)
    GUICtrlSetFont(-1, $iFS, 400, 0, "Comic Sans MS", 2)
    GUICtrlSetColor(-1, 0x006000)
    Next
    Global $aLabelCredit_AnimPos[300]
    For $u = 0 To UBound($aLabelCredit_AnimPos) - 1
    $aLabelCredit_AnimPos[$u] = $iY
    Next
    Global Const $fLimes = 2.2, $fStep = 0.1
    Global $iPT = 0, $z = Int((UBound($aLabelCredit_AnimPos) - ($fLimes * $fStep * 100)) / 2)
    For $u = 0 To $fLimes Step $fStep
    $aLabelCredit_AnimPos[$z] = $iY + Sin($iPT * 4) * 10
    $z += 1
    $iPT += 0.075
    Next

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

    Global $ihGui_PreviewSize = 200, $iBGColor = 0xF0F0F0
    Global $hGui_Preview = GUICreate("", $ihGui_PreviewSize, $ihGui_PreviewSize + 58, -1, -1, $WS_POPUP + $WS_BORDER, $WS_EX_TOPMOST, $hGUI)
    Global $iPic_Preview = GUICtrlCreatePic("", 0, 0, $ihGui_PreviewSize, $ihGui_PreviewSize)
    Global $idLabel_Info = GUICtrlCreateLabel("", 0, $ihGui_PreviewSize, $ihGui_PreviewSize * 2, 58)
    GUICtrlSetFont(-1, 8.5, 400, 0, "Arial", 5)
    GUICtrlSetColor(-1, $iBGColor)
    GUICtrlSetBkColor(-1, 0x333333)

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

    Global $hHBmp_L = _GDIPlus_CreateColorGradient("L", 256, 24)
    Global $hHBmp_C = _GDIPlus_CreateColorGradient("C", 256, 24)
    Global $hHBmp_R = _GDIPlus_CreateColorGradient("R", 256, 24)
    Global $hHBmp_G = _GDIPlus_CreateColorGradient("G", 256, 24)
    Global $hHBmp_B = _GDIPlus_CreateColorGradient("B", 256, 24)
    Global $aRes = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", 256, "int", 127, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Global Const $hHBmp_HL = $aRes[6]
    Global Const $hCtxt_HL = _GDIPlus_ImageGetGraphicsContext($hHBmp_HL)
    Global Const $hHBmp_HC = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A)
    Global Const $hCtxt_HC = _GDIPlus_ImageGetGraphicsContext($hHBmp_HC)
    Global Const $hHBmp_HR = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A)
    Global Const $hCtxt_HR = _GDIPlus_ImageGetGraphicsContext($hHBmp_HR)
    Global Const $hHBmp_HG = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A)
    Global Const $hCtxt_HG = _GDIPlus_ImageGetGraphicsContext($hHBmp_HG)
    Global Const $hHBmp_HB = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A)
    Global Const $hCtxt_HB = _GDIPlus_ImageGetGraphicsContext($hHBmp_HB)
    _GDIPlus_GraphicsClear($hCtxt_HL, 0xFFFFFFFF)

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

    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_L)

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

    Global $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HL)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)

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

    GUISetState(@SW_HIDE, $hGui_Preview)
    GUISetState(@SW_SHOW, $hGUI)
    ControlFocus($hGUI, "", $iButton_Load)

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

    Global $hPen_H = _GDIPlus_PenCreate()

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

    $s = "L"
    Global $iDummyL = GUICtrlCreateDummy(), $iDummyC = GUICtrlCreateDummy(), $iDummyR = GUICtrlCreateDummy(), $iDummyG = GUICtrlCreateDummy(), $iDummyB = GUICtrlCreateDummy()
    Global $iHistogramFormat, $hHBmp_Preview, $aPosCtrl, $aPosWin, $aMouseInfo, $aPos_hWnd, $imp, $iVal, $iMpos_oldx, $iMpos_oldy, $sType, $iPaletteType, $iPixelFormat, $fAverage_L, $fAverage_cRGB, $o = 0
    Global $bShow = False, $bHide = False, $bIsAlpha = False, $bIsGray = False
    Global Const $iEntries = 1024
    Global Const $tagCOLORPALETTE = "uint Flags;" & _ ; Palette flags
    "uint Count;" & _ ; Number of color entries
    "uint ARGB[" & $iEntries & "];" ; Palette color

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

    $iPaletteType = $PaletteTypeFixedHalftone8
    $iPixelFormat = $GDIP_PXF08INDEXED
    Global $tPalette = DllStructCreate($tagCOLORPALETTE)
    DllStructSetData($tPalette, "Flags", $iPaletteType)
    DllStructSetData($tPalette, "Count", $iEntries)
    Global $pPalette = DllStructGetPtr($tPalette)
    DllCall($ghGDIPDll, "int", "GdipInitializePalette", "struct*", $pPalette, "long", $iPaletteType, "int", 0, "bool", True, "handle", 0)

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

    AdlibRegister("AnimateLabel", 60)

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE, $iButton_Exit
    AdlibUnRegister("AnimateLabel")
    GUIDelete($hGui_Preview)
    GUIDelete($hGUI)
    _WinAPI_DeleteObject($hHBmp_L)
    _WinAPI_DeleteObject($hHBmp_C)
    _WinAPI_DeleteObject($hHBmp_L)
    _WinAPI_DeleteObject($hHBmp_R)
    _WinAPI_DeleteObject($hHBmp_G)
    _WinAPI_DeleteObject($hHBmp_B)
    If $hHBmp_Preview Then _WinAPI_DeleteObject($hHBmp_Preview)
    _GDIPlus_PenDispose($hPen_H)
    _GDIPlus_GraphicsDispose($hCtxt_HL)
    _GDIPlus_GraphicsDispose($hCtxt_HC)
    _GDIPlus_GraphicsDispose($hCtxt_HR)
    _GDIPlus_GraphicsDispose($hCtxt_HG)
    _GDIPlus_GraphicsDispose($hCtxt_HB)
    _GDIPlus_BitmapDispose($hHBmp_HL)
    _GDIPlus_BitmapDispose($hHBmp_HC)
    _GDIPlus_BitmapDispose($hHBmp_HR)
    _GDIPlus_BitmapDispose($hHBmp_HG)
    _GDIPlus_BitmapDispose($hHBmp_HB)
    _GDIPlus_Shutdown()
    $tStructChannel0 = 0
    $tStructChannel1 = 0
    $tStructChannel2 = 0
    $tStructChannel3 = 0
    Exit
    Case $iRadio_L, $iDummyL
    If $s <> "L" Then
    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_L)
    If $bImgLoaded Then
    $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HL)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)
    EndIf
    $s = "L"
    EndIf
    Case $iRadio_C, $iDummyC
    If $s <> "C" Then
    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_C)
    If $bImgLoaded Then
    $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HC)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)
    EndIf
    $s = "C"
    EndIf
    Case $iRadio_R, $iDummyR
    If $s <> "R" Then
    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_R)
    If $bImgLoaded Then
    $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HR)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)
    EndIf
    $s = "R"
    EndIf
    Case $iRadio_G, $iDummyG
    If $s <> "G" Then
    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_G)
    If $bImgLoaded Then
    $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HG)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)
    EndIf
    $s = "G"
    EndIf
    Case $iRadio_B, $iDummyB
    If $s <> "B" Then
    _hBmpToPicControl($iPic_ColorGradient, $hHBmp_B)
    If $bImgLoaded Then
    $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HB)
    _hBmpToPicControl($iPic_Histogram, $hB_H, 1)
    EndIf
    $s = "B"
    EndIf
    Case $iButton_Load
    $sFile = FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.bmp;*.gif)", 3)
    If @error Then ContinueCase
    If $bImgLoaded Then _GDIPlus_ImageDispose($hImage)
    $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    If @error Then
    MsgBox(0x40010, "Error", "Unable to load image", 30)
    ContinueCase
    EndIf
    GUICtrlSetState($iButton_Save, $GUI_ENABLE)
    $aRes = DllCall($ghGDIPDll, "int", "GdipGetImageFlags", "handle", $hImage, "uint*", 0)
    If BitAND($aRes[2], $ImageFlagsHasAlpha) Then
    $bIsAlpha = True
    Else
    $bIsAlpha = False
    EndIf
    If BitAND($aRes[2], $ImageFlagsColorSpaceGRAY) Then
    $bIsGray = True
    Else
    $bIsGray = False
    EndIf
    $hHBmp_Preview = _GetImage($sFile, $ihGui_PreviewSize, $iBGColor)
    _hBmpToPicControl($iPic_Preview, $hHBmp_Preview, 1)
    If Not $bIsAlpha Then
    $pStructChannel3 = 0
    $iHistogramFormat = $HistogramFormatRGB
    Else
    $pStructChannel3 = DllStructGetPtr($tStructChannel3)
    $iHistogramFormat = $HistogramFormatARGB
    EndIf
    _GDIPlus_BitmapGetHistogram($hImage, $iHistogramFormat, _GDIPlus_BitmapGetHistogramSize($iHistogramFormat), $pStructChannel0, $pStructChannel1, $pStructChannel2, $pStructChannel3)
    _GDIPlus_CreateHistogram()
    $bImgLoaded = True
    If BitAND(GUICtrlRead($iRadio_L), $GUI_CHECKED) Then
    $s = ""
    GUICtrlSendToDummy($iDummyL)
    ElseIf BitAND(GUICtrlRead($iRadio_C), $GUI_CHECKED) Then
    $s = ""
    GUICtrlSendToDummy($iDummyC)
    ElseIf BitAND(GUICtrlRead($iRadio_R), $GUI_CHECKED) Then
    $s = ""
    GUICtrlSendToDummy($iDummyR)
    ElseIf BitAND(GUICtrlRead($iRadio_G), $GUI_CHECKED) Then
    $s = ""
    GUICtrlSendToDummy($iDummyG)
    Else
    $s = ""
    GUICtrlSendToDummy($iDummyB)
    EndIf
    Case $iButton_Save
    If $sFile = "" Then ContinueLoop
    $sType = "png"
    DllCall($ghGDIPDll, "int", "GdipBitmapConvertFormat", "handle", $hHBmp_HL, "long", $iPixelFormat, "long", $DitherTypeSolid, "long", $iPaletteType, "struct*", $pPalette, "float", 0.0)
    DllCall($ghGDIPDll, "int", "GdipBitmapConvertFormat", "handle", $hHBmp_HC, "long", $iPixelFormat, "long", $DitherTypeSolid, "long", $iPaletteType, "struct*", $pPalette, "float", 0.0)
    DllCall($ghGDIPDll, "int", "GdipBitmapConvertFormat", "handle", $hHBmp_HR, "long", $iPixelFormat, "long", $DitherTypeSolid, "long", $iPaletteType, "struct*", $pPalette, "float", 0.0)
    DllCall($ghGDIPDll, "int", "GdipBitmapConvertFormat", "handle", $hHBmp_HG, "long", $iPixelFormat, "long", $DitherTypeSolid, "long", $iPaletteType, "struct*", $pPalette, "float", 0.0)
    DllCall($ghGDIPDll, "int", "GdipBitmapConvertFormat", "handle", $hHBmp_HB, "long", $iPixelFormat, "long", $DitherTypeSolid, "long", $iPaletteType, "struct*", $pPalette, "float", 0.0)
    $o += _GDIPlus_ImageSaveToFile($hHBmp_HL, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Luminosity." & $sType)
    $o += _GDIPlus_ImageSaveToFile($hHBmp_HC, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_cRGB." & $sType)
    $o += _GDIPlus_ImageSaveToFile($hHBmp_HR, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Red." & $sType)
    $o += _GDIPlus_ImageSaveToFile($hHBmp_HG, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Green." & $sType)
    $o += _GDIPlus_ImageSaveToFile($hHBmp_HB, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Blue." & $sType)
    If $o = 5 Then
    MsgBox(64 + 262144, "Information", "Images properly saved to " & StringRegExpReplace($sFile, "(.*)\\.*", "$1"), 30, $hGUI)
    Else
    MsgBox(16 + 262144, "Error", "One or more images could not saved to " & StringRegExpReplace($sFile, "(.*)\\.*", "$1") & ".", 30, $hGUI)
    EndIf
    EndSwitch
    If WinActive($hGUI) Then
    $aMouseInfo = GUIGetCursorInfo($hGUI)
    Switch $aMouseInfo[4]
    Case $iPic_Histogram
    If $bImgLoaded Then
    $aPos_hWnd = WinGetPos($hGUI)
    $imp = Max(1, Min(256, -19 + $aMouseInfo[0]))
    Switch $s
    Case "L"
    $iVal = $aLuminosity[$imp]
    Case "C"
    $iVal = $aCRGB[$imp]
    Case "R"
    $iVal = DllStructGetData($tStructChannel0, "channel0", $imp)
    Case "G"
    $iVal = DllStructGetData($tStructChannel1, "channel1", $imp)
    Case "B"
    $iVal = DllStructGetData($tStructChannel2, "channel2", $imp)
    EndSwitch
    If $iMpos_oldx <> $aMouseInfo[0] Or $iMpos_oldy <> $aMouseInfo[1] Then
    ToolTip("Index: " & $imp & ", Value: " & Round($iVal, 0) & ", Average: " & Round($fAverage_L, 2), $aPos_hWnd[0] + $aMouseInfo[0] - 60, $aMouseInfo[1] + $aPos_hWnd[1] - 20)
    $iMpos_oldx = $aMouseInfo[0]
    $iMpos_oldy = $aMouseInfo[1]
    EndIf
    ShowPreview($iPic_Histogram)
    $bShow = True
    $bHide = False

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

    EndIf
    Case Else
    If Not $bHide Then
    GUISetState(@SW_HIDE, $hGui_Preview)
    $bHide = True
    ToolTip("")
    EndIf
    $bShow = False
    EndSwitch
    EndIf
    WEnd

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

    Func AnimateLabel()
    Local Static $v = Int((UBound($aLabelCredit_AnimPos) - ($fLimes * $fStep * 100)) / 2)
    Local $u
    For $u = 0 To UBound($aLabelCredit_Pos) - 1
    GUICtrlSetPos($aLabelCredit_Pos[$u][3], $aLabelCredit_Pos[$u][1], $aLabelCredit_AnimPos[$v - $u])
    Next
    If $v - $u < 0 Then $v = UBound($aLabelCredit_AnimPos) - 1
    $v -= 1
    EndFunc ;==>AnimateLabel

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

    Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
    EndFunc ;==>Min

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

    Func Max($a, $b)
    If $a > $b Then Return $a
    Return $b
    EndFunc ;==>Max

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

    Func ShowPreview($iCtrl)
    $aPosWin = WinGetPos($hGUI)
    $aPosCtrl = ControlGetPos($hGUI, "", $iCtrl)
    Local $iNewX, $iNewX1 = $aPosWin[0] - $ihGui_PreviewSize + 10, $iNewX2 = $aPosWin[0] + $aPosWin[2] - 10
    $iNewX = $iNewX1
    If $iNewX1 < $aFullScreen[0] Then
    $iNewX = $iNewX2
    EndIf
    WinMove($hGui_Preview, "", $iNewX, $aPosWin[1] + 50)
    GUISetState(@SW_SHOWNOACTIVATE, $hGui_Preview)
    EndFunc ;==>ShowPreview

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

    Func _GetImage($sFile, $iWH, $iBkClr = 0xFFFFFF)
    Local $hBmp1, $hBitmap, $hGraphic, $hImage, $iW, $iH, $aGS, $hBmp2, $aFTS
    $aFTS = FileGetTime($sFile)
    If @error Then Return SetError(1, 0, 0)
    $hBmp1 = _WinAPI_CreateBitmap($iWH, $iWH, 1, 32)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp1)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _WinAPI_DeleteObject($hBmp1)
    _GDIPlus_GraphicsClear($hGraphic, BitOR(0xFF000000, $iBkClr))
    $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    $iW = _GDIPlus_ImageGetWidth($hImage)
    $iH = _GDIPlus_ImageGetHeight($hImage)
    GUICtrlSetData($idLabel_Info, StringRegExpReplace($sFile, ".*\\(.*)", "$1") & @LF & Round(FileGetSize($sFile) / 1024, 0) & " kb (" & $iW & " x " & $iH & ")" & @LF & $aFTS[0] & "/" & $aFTS[1] & "/" & $aFTS[2] & " " & $aFTS[3] & ":" & $aFTS[4] & ":" & $aFTS[5] & @LF & "Alpha: " & $bIsAlpha & ", Gray: " & $bIsGray)
    $aGS = _GetScale($iW, $iH, $iWH)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $aGS[0], $aGS[1], $aGS[2], $aGS[3])
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic)
    $hBmp2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    Return $hBmp2
    EndFunc ;==>_GetImage

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

    Func _GetScale($iW, $iH, $iWH)
    Local $aRet[4]
    If $iW <= $iWH And $iH <= $iWH Then
    $aRet[2] = $iW
    $aRet[3] = $iH
    $aRet[0] = ($iWH - $aRet[2]) / 2
    $aRet[1] = ($iWH - $aRet[3]) / 2
    ElseIf $iW > $iH Then
    $aRet[2] = $iWH
    $aRet[3] = $iH / ($iW / $iWH)
    $aRet[0] = 0
    $aRet[1] = ($iWH - $aRet[3]) / 2
    ElseIf $iW < $iH Then
    $aRet[2] = $iW / ($iH / $iWH)
    $aRet[3] = $iWH
    $aRet[0] = ($iWH - $aRet[2]) / 2
    $aRet[1] = 0
    ElseIf $iW = $iH Then
    $aRet[2] = $iWH
    $aRet[3] = $iWH
    $aRet[0] = 0
    $aRet[1] = 0
    EndIf
    Return $aRet
    EndFunc ;==>_GetScale

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

    Func _hBmpToPicControl($iCID, ByRef $hBmp, $iFlag = 0)
    Local $hOldBmp
    $hOldBmp = GUICtrlSendMsg($iCID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp)
    If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp)
    If $iFlag Then _WinAPI_DeleteObject($hBmp)
    EndFunc ;==>_hBmpToPicControl

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

    Func _GDIPlus_CreateHistogram($sRounding = "Ceiling")
    Local $iMaxL, $iMaxC, $iMaxR, $iMaxG, $iMaxB, $a, $r, $g, $b, $yR, $yG, $yB
    For $i = 1 + $bIsAlpha To 256
    If $bIsAlpha Then
    ;~ ConsoleWrite("Alpha: " & DllStructGetData($tStructChannel0, "channel0", $i) & @CRLF)
    $r = DllStructGetData($tStructChannel1, "channel1", $i)
    $yR = $r * $frY
    If DllStructGetData($tStructChannel1 , "channel1", $i) > $iMaxR Then $iMaxR = $r

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

    $g = DllStructGetData($tStructChannel2, "channel2", $i)
    $yG = $g * $fgY
    If DllStructGetData($tStructChannel2 , "channel2", $i) > $iMaxG Then $iMaxG = $g

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

    $b = DllStructGetData($tStructChannel3, "channel3", $i)
    $yB = $b * $fbY
    If DllStructGetData($tStructChannel3 , "channel3", $i) > $iMaxB Then $iMaxB = $b

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

    $fAverage_cRGB += $r + $g + $b
    $fAverage_L += $yR + $yG + $yB
    Else
    $r = DllStructGetData($tStructChannel0, "channel0", $i)
    $yR = $r * $frY
    If DllStructGetData($tStructChannel0 , "channel0", $i) > $iMaxR Then $iMaxR = $r

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

    $g = DllStructGetData($tStructChannel1, "channel1", $i)
    $yG = $g * $fgY
    If DllStructGetData($tStructChannel1 , "channel1", $i) > $iMaxG Then $iMaxG = $g

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

    $b = DllStructGetData($tStructChannel2, "channel2", $i)
    $yB = $b * $fbY
    If DllStructGetData($tStructChannel2 , "channel2", $i) > $iMaxB Then $iMaxB = $b
    EndIf

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

    $fAverage_cRGB += $r + $g + $b
    $fAverage_L += $yR + $yG + $yB

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

    $aLuminosity[$i] = $yR + $yG + $yB
    If $aLuminosity[$i] > $iMaxL Then $iMaxL = $aLuminosity[$i]

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

    $aCRGB[$i] = ($r + $g + $b) / 3
    If $aCRGB[$i] > $iMaxC Then $iMaxC = $aCRGB[$i]
    Next
    $fAverage_cRGB /= 256 * 3
    $fAverage_L /= 256

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

    _GDIPlus_GraphicsClear($hCtxt_HL, 0xFFFFFFFF)
    _GDIPlus_GraphicsClear($hCtxt_HC, 0xFFFFFFFF)
    _GDIPlus_GraphicsClear($hCtxt_HR, 0xFFFFFFFF)
    _GDIPlus_GraphicsClear($hCtxt_HG, 0xFFFFFFFF)
    _GDIPlus_GraphicsClear($hCtxt_HB, 0xFFFFFFFF)

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

    Local $iDL = 1, $iDC = 1, $iDR = 1, $iDG = 1, $iDB = 1
    Local $sRoundings = "Round,Ceiling,Floor,"
    If Not StringInStr($sRoundings, $sRounding) Then $sRounding = "Ceiling"
    If $iMaxL > 128 Then
    ;~ $iDL = Ceiling($iMaxL / 128)
    $iDL = Execute($sRounding & "(" & $iMaxL / 128 & ")")
    Else
    $iDL = 1 / (128 / $iMaxL)
    EndIf
    If $iMaxC > 128 Then
    ;~ $iDC = Ceiling($iMaxC / 128)
    $iDC = Execute($sRounding & "(" & $iMaxC / 128 & ")")
    Else
    $iDC = 1 / (128 / $iMaxC)
    EndIf
    If $iMaxR > 128 Then
    ;~ $iDR = Ceiling($iMaxR / 128)
    $iDR = Execute($sRounding & "(" & $iMaxR / 128 & ")")
    Else
    $iDR = 1 / (128 / $iMaxR)
    EndIf
    If $iMaxG > 128 Then
    ;~ $iDG = Ceiling($iMaxG / 128)
    $iDG = Execute($sRounding & "(" & $iMaxG / 128 & ")")
    Else
    $iDG = 1 / (128 / $iMaxG)
    EndIf
    If $iMaxB > 128 Then
    ;~ $iDB = Ceiling($iMaxB / 128)
    $iDB = Execute($sRounding & "(" & $iMaxB / 128 & ")")
    Else
    $iDB = 1 / (128 / $iMaxB)
    EndIf
    For $i = 1 To 256
    _GDIPlus_PenSetColor($hPen_H, 0xFF000000)
    _GDIPlus_GraphicsDrawLine($hCtxt_HL, $i - 1, 127, $i - 1, 127 - (Int($aLuminosity[$i] / $iDL)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFF000000)
    _GDIPlus_GraphicsDrawLine($hCtxt_HC, $i - 1, 127, $i - 1, 127 - (Int($aCRGB[$i] / $iDC)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFFB00000)
    If $bIsAlpha Then
    _GDIPlus_GraphicsDrawLine($hCtxt_HR, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel1, "channel1", $i) / $iDR)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFF00B000)
    _GDIPlus_GraphicsDrawLine($hCtxt_HG, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel2, "channel2", $i) / $iDG)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFF0000B0)
    _GDIPlus_GraphicsDrawLine($hCtxt_HB, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel3, "channel3", $i) / $iDB)), $hPen_H)
    Else
    _GDIPlus_GraphicsDrawLine($hCtxt_HR, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel0, "channel0", $i) / $iDR)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFF00B000)
    _GDIPlus_GraphicsDrawLine($hCtxt_HG, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel1, "channel1", $i) / $iDG)), $hPen_H)
    _GDIPlus_PenSetColor($hPen_H, 0xFF0000B0)
    _GDIPlus_GraphicsDrawLine($hCtxt_HB, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel2, "channel2", $i) / $iDB)), $hPen_H)
    EndIf
    Next

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

    EndFunc ;==>_GDIPlus_CreateHistogram

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

    Func _GDIPlus_CreateColorGradient($sColorChannel, $iW, $iH, $bHBitmap = True)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($aResult[6])
    ;~ _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    Local $hPen = _GDIPlus_PenCreate()
    DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "handle", $hPen, "int", $iLineJoinBevel)
    Local $i, $c
    For $i = 0 To $iW
    $c = Hex($i, 2)
    Switch $sColorChannel
    Case "L"
    _GDIPlus_PenSetColor($hPen, "0xFF" & $c & $c & $c)
    Case "C"
    _GDIPlus_PenSetColor($hPen, "0xFF" & $c & $c & $c)
    Case "R"
    _GDIPlus_PenSetColor($hPen, "0xFF" & $c & "0000")
    Case "G"
    _GDIPlus_PenSetColor($hPen, "0xFF00" & $c & "00")
    Case "B"
    _GDIPlus_PenSetColor($hPen, "0xFF0000" & $c)
    EndSwitch
    _GDIPlus_GraphicsDrawLine($hCtxt, $i, 0, $i, $iH, $hPen)
    Next
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_PenDispose($hPen)
    If $bHBitmap Then
    Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aResult[6])
    _GDIPlus_BitmapDispose($aResult[6])
    Return $hHBmp
    EndIf
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_CreateColorGradient

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

    ;http://msdn.microsoft.com/en-us/library/…7(v=vs.85).aspx
    Func _GDIPlus_BitmapGetHistogram($hBitmap, $iFormat, $iGetHistogramSize, $pStructChannel0, $pStructChannel1, $pStructChannel2, $pStructChannel3 = 0)
    Local $aRes = DllCall($ghGDIPDll, "bool", "GdipBitmapGetHistogram", "handle", $hBitmap, "uint", $iFormat, "uint", $iGetHistogramSize, "struct*", $pStructChannel0, "struct*", $pStructChannel1, "struct*", $pStructChannel2, "struct*", $pStructChannel3)
    If @error Then Return SetError(1, @error, 0)
    Return 1
    EndFunc ;==>_GDIPlus_BitmapGetHistogram

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

    ;http://msdn.microsoft.com/en-us/library/…8(v=vs.85).aspx
    Func _GDIPlus_BitmapGetHistogramSize($iFormat)
    Local $aRes = DllCall($ghGDIPDll, "int", "GdipBitmapGetHistogramSize", "uint", $iFormat, "dword*", 0)
    If @error Then Return SetError(1, @error, 0)
    Return $aRes[2]
    EndFunc ;==>_GDIPlus_BitmapGetHistogramSize

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

    Func _GDIPlus11_Startup() ;code by Authenticity - modified by UEZ
    Local $pInput, $tInput, $pToken, $tToken, $aResult, $os

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

    $giGDIPRef += 1
    If $giGDIPRef > 1 Then Return True

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

    Switch @OSVersion
    Case "WIN_VISTA", "WIN_2008"
    $ghGDIPDll = DllOpen(@WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll")
    Case "WIN_2008R2", "WIN_7", "WIN_8"
    $ghGDIPDll = DllOpen(@SystemDir & "\gdiplus.dll")
    Case Else
    Return SetError(1)
    EndSwitch
    ;~ _WinAPI_Check("_GDIPlus_Startup (GDIPlus.dll not found)", @error, False)

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

    $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
    $pInput = DllStructGetPtr($tInput)
    $tToken = DllStructCreate("int Data")
    $pToken = DllStructGetPtr($tToken)
    DllStructSetData($tInput, "Version", 1)
    $aResult = DllCall($ghGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    $giGDIPToken = DllStructGetData($tToken, "Data")
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus11_Startup

    [/autoit]

    Keine Ahnung für was man sowas gebrauchen kann...

    Läuft ab Vista und aufwärts, da GDI+ v1.1 benötigt wird.

    Gruß,
    UEZ

    Dateien

    Histogram.png 38,12 kB – 0 Downloads GDI+ Show Histogram.au3 27,53 kB – 412 Downloads
  • Kleinster HD-Kurzfilm

    • UEZ
    • 31. Januar 2013 um 19:12

    Ich dachte Farbrausch wäre eine Deutsche Gruppe, was nahe liegend ist, aber dem ist nicht so...

    Ich vermute, dass die Sachen auf meine Notebook nicht laufen werden, da Intel Gfx Karte... :(

    Gruß,
    UEZ

  • Kleinster HD-Kurzfilm

    • UEZ
    • 31. Januar 2013 um 14:59

    Cool, danke für den Link!

    Da ich kein C++ kann, wird das wohl sehr schwierig werden, was zu kapieren.

    Gruß,
    UEZ

  • Desktop effects - 22 Effekte mit BitBlt (früher Melting Desktop)

    • UEZ
    • 30. Januar 2013 um 09:00

    Sind ein paar schöne Effekte dabei!

    Gruß,
    UEZ

  • CMD/DOS Ausgabe eines Programms in GUI ausgeben/anzeigen?

    • UEZ
    • 28. Januar 2013 um 12:02

    Vielleicht kannst du hiermit was anfangen: http://www.autoitscript.com/forum/topic/14…md/#entry987814

    Gruß,
    UEZ

  • Flackerndes GUI bei Aktualisierung der Label

    • UEZ
    • 25. Januar 2013 um 19:49

    Sieht so aus, dass die Lösung funktioniert, aber das Flackern fängt wieder an, sobald man ein Pic Control, z.B. als Hintergrung Bild, erstellt.

    Hier ein Workaround, um ein Transparenz Effekt zu bekommen:

    Spoiler anzeigen
    [autoit]


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

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

    _GDIPlus_Startup()
    Global $iCtrlX = 10, $iCtrlY = 70, $iCtrlW = 250, $iCtrlH = 20
    $hGUI = GUICreate("Test", 450, 100);, -1, -1, Default, BitOR($WS_EX_COMPOSITED, $WS_EX_TOPMOST, $WS_EX_LAYERED))
    $iPic_bg = GUICtrlCreatePic("", 0, 0, 450, 100)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $iLabel = GUICtrlCreateLabel("Standard Control: 0000000000", 10, 10, $iCtrlW, $iCtrlH)
    GUICtrlSetFont(-1, 11, 400, 0, "Arial")
    $iPic = GUICtrlCreatePic("", $iCtrlX, $iCtrlY, $iCtrlW, $iCtrlH)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $hBG_Image = _ScreenCapture_Capture("", 0, @DesktopHeight - 100, 450, @DesktopHeight)
    $hB = GUICtrlSendMsg($iPic_bg, 0x0172, 0, $hBG_Image)
    If $hB Then _WinAPI_DeleteObject($hB)
    GUISetState()

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

    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBG_Image)
    _WinAPI_DeleteObject($hBG_Image)
    $hImgBg_Rect = _GDIPlus_CropImage($hImage, $iCtrlX, $iCtrlY, $iCtrlW, $iCtrlH)

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

    Do
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    GUIDelete()
    _GDIPlus_BitmapDispose($hImgBg_Rect)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    GUICtrlSetData($iLabel, "Standard Control: " & Random(1111111111, 99999999999, 1)) ;standard control is flickering
    _GDIPlus_DrwTxt2Ctrl($hGUI, $iPic, "Graphic Control: " & Random(1111111111, 99999999999, 1), $hImgBg_Rect, 11, "Arial", 0xFFF0F080, 0xFFF0F0F0, 1) ;workaround using GDI+
    Until False

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

    Func _GDIPlus_DrwTxt2Ctrl($hWnd, $iCtrl, $sText, $hBgImage = 0, $iFontSize = 11, $sFont = "Arial", $iFontColor = 0xFF000000, $iBgColor = 0xFFF0F0F0, $iAlign = 0, $bAntiAlias = False) ;coded by UEZ build 2013-01-17
    Local $hCtrl = GUICtrlGetHandle($iCtrl)
    Local $aSize = ControlGetPos($hWnd, "", $iCtrl)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aSize[2], "int", $aSize[3], "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local $hBitmap = $aResult[6]
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    If $hBgImage Then
    _GDIPlus_GraphicsDrawImage($hCtxt, $hBgImage, 0, 0)
    Else
    _GDIPlus_GraphicsClear($hCtxt, $iBgColor)
    EndIf
    If $bAntiAlias Then
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4)
    EndIf
    Local $hBrush = _GDIPlus_BrushCreateSolid($iFontColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hFormat, $iAlign)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize)
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, $aSize[2], $aSize[3])
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $sText, $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hCtxt)
    Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    Local $hB = GUICtrlSendMsg($iCtrl, 0x0172, 0, $hHBitmap)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBitmap)
    Return 1
    EndFunc

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

    Func _GDIPlus_CropImage($hImage, $iX, $iY, $iW, $iH, $bHBitmap = False)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($aResult[6])
    _GDIPlus_GraphicsDrawImageRectRect($hCtxt, $hImage, $iX, $iY, $iW, $iH, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDispose($hCtxt)
    If $bHBitmap Then
    Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aResult[6])
    _GDIPlus_BitmapDispose($aResult[6])
    Return $hHBmp
    EndIf
    Return $aResult[6]
    EndFunc

    [/autoit]

    Wenn kein Bild als Hintergrund gewählt ist, dann einfach in Zeile 33 $hImgBg_Rect durch 0 ersetzen und den Parameter für $iBgColor entsprechend wählen.

    Was besseres ist mir im Moment nicht eingefallen.

    Gruß,
    UEZ

  • Flackerndes GUI bei Aktualisierung der Label

    • UEZ
    • 25. Januar 2013 um 14:38

    Tweaky: wenn ich ein bissl Zeit finde, füge ich deine Vorschläge noch hinzu.

    Gruß,
    UEZ

  • Liniendiagramm erstellen

    • UEZ
    • 21. Januar 2013 um 22:15

    Schaue mal hier rein: http://www.autoitscript.com/forum/topic/10…gdi-line-graphs

    Gruß,
    UEZ

  • Hexrechnung

    • UEZ
    • 19. Januar 2013 um 13:18

    Klar kannst du in Hex rechnen:

    [autoit]


    $ADDR_Base = 0x123ABC00
    $ADDR_Offset = 0x2BC12

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

    $A = $ADDR_Base + $ADDR_Offset
    msgbox (0,"$A","0x"&Hex($A,8)) ; -> 123D7812

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

    $B = $A + 0x54
    msgbox (0,"$B","0x"&Hex($B,8)) ; -> 00000000

    [/autoit]

    Hex() dient nur zum Anzeigen der Hex Werte!

    Gruß,
    UEZ

  • Happy Birthday Oscar

    • UEZ
    • 18. Januar 2013 um 23:36

    Ich schließe mich auch an und wünsche dir alles Gute zum Geburtstag!

    Gruß,
    UEZ

  • Flackerndes GUI bei Aktualisierung der Label

    • UEZ
    • 18. Januar 2013 um 11:18

    Standard Control sollte flackern und Graphic Control nicht!

    Der Rest ist Geschmacksache!

    Greenhorn: leider hilft $WS_EX_COMPOSITED nicht...

    Gruß,
    UEZ

  • Flackerndes GUI bei Aktualisierung der Label

    • UEZ
    • 17. Januar 2013 um 21:06

    Hier noch eine Version:

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    _GDIPlus_Startup()
    $hGUI = GUICreate("Test", 300, 150)
    $iLabel = GUICtrlCreateLabel("Standard Control: 0000000000", 10, 10, 290, 50)
    GUICtrlSetFont(-1, 11, 400, 0, "Arial")
    $iPic = GUICtrlCreatePic("", 10, 80, 250, 50)
    GUISetState()
    _GDIPlus_DrwTxt2Ctrl($hGUI, $iPic, "Graphic Control: 0000000000")

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

    Do
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    GUIDelete()
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    GUICtrlSetData($iLabel, "Standard Control: " & Random(1111111111, 99999999999, 1))
    _GDIPlus_DrwTxt2Ctrl($hGUI, $iPic, "Graphic Control: " & Random(1111111111, 99999999999, 1))
    Until False

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

    Func _GDIPlus_DrwTxt2Ctrl($hWnd, $iCtrl, $sText, $iFontSize = 11, $sFont = "Arial", $iFontColor = 0xFF000000, $iBgColor = 0xFFF0F0F0, $bAntiAlias = False) ;coded by UEZ build 2013-01-17
    Local $hCtrl = GUICtrlGetHandle($iCtrl)
    Local $aSize = ControlGetPos($hWnd, "", $iCtrl)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aSize[2], "int", $aSize[3], "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local $hBitmap = $aResult[6]
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsClear($hCtxt, $iBgColor)
    If $bAntiAlias Then
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4)
    EndIf
    Local $hBrush = _GDIPlus_BrushCreateSolid($iFontColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize)
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, $aSize[2], $aSize[3])
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $sText, $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hCtxt)
    Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    Local $hB = GUICtrlSendMsg($iCtrl, 0x0172, 0, $hHBitmap)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBitmap)
    Return 1
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Extract File by C0dex

    • UEZ
    • 10. Januar 2013 um 09:01

    Spanish Forum -> http://www.emesn.com/autoitforum/index.php

    Veo que ya estás registrado allí (C0dex). 8|

    Saludo,
    UEZ

  • Musik-Visualizer mit optimiertem ASM

    • UEZ
    • 8. Januar 2013 um 21:35

    Danke für dem ASM Kurs!

    Gruß,
    UEZ

  • Desktop effects - 22 Effekte mit BitBlt (früher Melting Desktop)

    • UEZ
    • 6. Januar 2013 um 14:19
    Zitat von Andy

    hmm, die Verwendung von Windows-Standard-Funktionen funktioniert nicht bei Win8? Btw. was funktioniert nicht bzw. was ist der Fehler?
    Bestätigt mein bisheriges Vorgehen, immer nur jede 2. BS-Version zu verwenden.

    Auf der physikalischen Kiste sehe ich nur ein graues Bild, sonst nichts. In der VM funzt allerdings der Effekt; komisch! ?( Scheint vielleicht an meiner Nvidia Gfx Karte zu liegen...

    Im Großen und Ganzen laufen alle die von mir getesteten Skripte, bis auf einige Kleinigkeiten. Win8 ist sehr gewohnheitsbedürftig und hat micht nicht vom Hocker gerissen, aber schnell im Booten.
    Mit der Zeit wird sich herausstellen, ob Win8 was taugt oder nicht.

    Gruß,
    UEZ

  • Desktop effects - 22 Effekte mit BitBlt (früher Melting Desktop)

    • UEZ
    • 6. Januar 2013 um 00:48

    Ich liebe den Aero Effekt. Leider gibt's den nicht mehr unter Win8! ;(

    Apropos Win8: das Skript läuft nicht unter Win8 auf meiner physikalischen Kiste!

    Gruß,
    UEZ

  • Desktop effects - 22 Effekte mit BitBlt (früher Melting Desktop)

    • UEZ
    • 5. Januar 2013 um 20:13

    Aha, jetzt sieht man den Effekt! :D

    Alternativ kann man auch Aero abschalten:

    Spoiler anzeigen
    [autoit]


    #include <ScreenCapture.au3>;....................

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

    Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
    Global $sChkAero = DllStructCreate("int;")
    DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
    Global $aero = DllStructGetData($sChkAero, 1)
    If $aero Then DllCall($hDwmApiDll, "int", "DwmEnableComposition", "uint", False)
    Sleep(500)
    Local $1=Opt("GUIOnEventMode",1),$c=b(0),$a= _;..
    @DesktopWidth,$b=@DesktopHeight,$3= _;...........
    _ScreenCapture_Capture("m.bmp",0,0,-1,-1, _;.....
    False),$d = GUICreate(0,$a,$b,0,0,0x80000000), _;
    $4=GUISetOnEvent(-3,"a"),$5=GUICtrlCreatePic( _;.
    "m.bmp",0,0,$a,$b),$e=b($d),$6=GUISetState();....
    Local $f,$g,$h,$i,$7
    While 1;.........................................
    $f=($a-128)*random(0,1)
    $g=($b-128)*random(0,1)
    $h=2*random(0,1)-1
    $i=2*random(0,1) -1
    $7=DllCall("gdi32.dll","bool","BitBlt","handle",$e,"int",$f+$h,"int",$g+$i,"int",128,"int",128,"handle",$c,"int",$f,"int",$g,"dword",0x00CC0020);....................................
    ;~ $7 = DllCall("gdi32.dll","bool","BitBlt","handle",$e,"int",int($f + $h), "int",int($g + $i),"int",128, "int",128,"handle",$e,"int",int($f),"int",int($g), "dword", 0x00CC0020) ;Andy's Variante
    WEnd;............................................
    Local $8=DllCall("user32.dll","int","ReleaseDC" _
    ,"hwnd",$d,"handle",$e),$9=DllCall("user32.dll" _
    ,"int","ReleaseDC","hwnd",0,"handle",$c);........
    Func a();........................................
    If $aero Then DllCall($hDwmApiDll, "int", "DwmEnableComposition", "uint", True)
    Exit;............................................
    EndFunc;.........................................
    Func b($j);......................................
    $k=DllCall("user32.dll","handle","GetDC","hwnd" _
    ,$j);............................................
    Return $k[0];....................................
    EndFunc;.........................................

    [/autoit]

    Gruß,
    UEZ

  • REGEX-(Mist)

    • UEZ
    • 2. Januar 2013 um 23:39

    Bin kein RegEx Guru, aber hier eine Möglichkeit:

    [autoit]


    $sDatei1 = "Test123ABC134_1.jpg"
    $sDatei2 = "123_456_789.jpg"

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

    ConsoleWrite(StringRegExp($sDatei1, "(?i)[^_\d\.jpg]", 0) & @LF)
    ConsoleWrite(StringRegExp($sDatei2, "(?i)[^_\d\.jpg]", 0) & @LF)

    [/autoit]

    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™