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. name22

Beiträge von name22

  • Von Bild Ring ausschneiden (kein Kreis!)

    • name22
    • 17. April 2010 um 23:16

    So, ein Beispiel:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>

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

    $iGUIWidth = 400
    $iGUIHeight = 400
    $GUIColorBG = 0xFF000000

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

    $iAngle = 1

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

    $hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
    _GDIPlus_GraphicsClear($hGraphic, $GUIColorBG)

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

    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Test.png")
    $hTextureBrush = _GDIPlus_TextureCreate2($hImage, 0, 0, 300, 300)

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

    AdlibRegister("_Draw", 20)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister()
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BrushDispose($hTextureBrush)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

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

    Func _Draw()
    $iAngle += 1
    _GDIPlus_GraphicsClear($hBuffer, $GUIColorBG)
    _GDIPlus_GraphicsFillPie($hBuffer, 50, 50, 100, 100, 90, $iAngle, $hTextureBrush)
    _GDIPlus_GraphicsFillEllipse($hBuffer, 83, 83, 36, 36)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
    EndFunc

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

    ;Die Funktionen sind nicht von mir!!
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_TextureCreate
    ; Description ...: Creates a TextureBrush object based on an image and a wrap mode
    ; Syntax.........: _GDIPlus_TextureCreate($hImage[, $iWrapMode = 0])
    ; Parameters ....: $hImage - Pointer to an Image object
    ; $iWrapMode - Wrap mode that specifies how repeated copies of an image are used to tile an area when it is
    ; +painted with the texture brush:
    ; |0 - Tiling without flipping
    ; |1 - Tiles are flipped horizontally as you move from one tile to the next in a row
    ; |2 - Tiles are flipped vertically as you move from one tile to the next in a column
    ; |3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
    ; |4 - No tiling takes place
    ; Return values .: Success - Pointer to a new TextureBrush 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 .......: The size of the brush defaults to the size of the image, so the entire image is used by the brush
    ; After you are done with the object, call _GDIPlus_BrushDispose to release the object resources
    ; Related .......: _GDIPlus_BrushDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateTexture
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_TextureCreate($hImage, $iWrapMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "hwnd", $hImage, "int", $iWrapMode, "int*", 0)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[3]
    EndFunc ;==>_GDIPlus_TextureCreate

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_TextureCreate2
    ; Description ...: Creates a TextureBrush object based on an image, a wrap mode and a defining rectangle
    ; Syntax.........: _GDIPlus_TextureCreate2($hImage, $nX, $nY, $nWidth, $nHeight[, $iWrapMode = 0])
    ; Parameters ....: $hImage - Pointer to an Image object
    ; $nX - Leftmost coordinate of the image portion to be used by this brush
    ; $nY - Uppermost coordinate of the image portion to be used by this brush
    ; $nWidth - Width of the brush and width of the image portion to be used by the brush
    ; $nHeight - Height of the brush and height of the image portion to be used by the brush
    ; $iWrapMode - Wrap mode that specifies how repeated copies of an image are used to tile an area when it is
    ; +painted with the texture brush:
    ; |0 - Tiling without flipping
    ; |1 - Tiles are flipped horizontally as you move from one tile to the next in a row
    ; |2 - Tiles are flipped vertically as you move from one tile to the next in a column
    ; |3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
    ; |4 - No tiling takes place
    ; Return values .: Success - Pointer to a new TextureBrush 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_BrushDispose to release the object resources
    ; Related .......: _GDIPlus_BrushDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateTexture2
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_TextureCreate2($hImage, $nX, $nY, $nWidth, $nHeight, $iWrapMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture2", "hwnd", $hImage, "int", $iWrapMode, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int*", 0)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[7]
    EndFunc ;==>_GDIPlus_TextureCreate2

    [/autoit]


    Müsste genau das machen was du gesagt hast. :)
    Wofür ist das ganze? Vielleicht geht es auch einfacher. ;)

  • Von Bild Ring ausschneiden (kein Kreis!)

    • name22
    • 17. April 2010 um 21:23

    Da empfiehlt sich wohl eher meine Methode. :P
    Wenn Bedarf besteht schreibe ich dir gern ein Beispiel. ;)

  • GDI+ Kreisförmiger Ausschnitt einer Bitmap

    • name22
    • 17. April 2010 um 21:20

    Klasse! Danke UEZ. :thumbup:

  • Von Bild Ring ausschneiden (kein Kreis!)

    • name22
    • 17. April 2010 um 15:24
    Zitat

    In 2 Schritten!
    Erst einen kreis ausschneiden und aus dem Objekt nen kleineren Kreis ! :)


    Das geht mit meinem aber auch :P.

  • Text aus einer GroupBox auslesen

    • name22
    • 17. April 2010 um 15:11
    Zitat


    Controll ID wäre ja [CLASS:Button; INSTANCE:22]


    Wieso steht das dann nicht in deinem Aufruf? :rolleyes:

  • Suche Jemand, der mir eine Leitstelle Coden kann

    • name22
    • 17. April 2010 um 14:41

    Sowas wäre eher ein Projekt für mehrere. :S

  • Text aus einer GroupBox auslesen

    • name22
    • 17. April 2010 um 14:11

    Du musst bei ControlGetText auch den Titel des Fensters angeben! Sowas weiß man wenn man die Hilfe befragt. ;)
    Schau dir einfach mal die Reihenfolge deiner Parameter an.

  • Von Bild Ring ausschneiden (kein Kreis!)

    • name22
    • 17. April 2010 um 13:56
    Zitat

    In der ShoutBox konnte auch niemand die frage beantworten


    Doch! Aber da warst du nicht mehr da. :D

    UEZ Auch eine interessante Lösung. :thumbup:

  • GDI+ Kreisförmiger Ausschnitt einer Bitmap

    • name22
    • 17. April 2010 um 01:57
    Zitat

    wow hätte nich gedacht das das mit so kurzem code geht


    Im Prinzip ist es ja auch nur ein DLLCall. ;)
    Der eigentliche, schwierigere, Teil steckt in der gdiplus.dll.


    Edit: Gibt es eigentlich Beispiele zur GDIP.au3? ?(
    Das wäre ja irgendwie ganz hilfreich. :D

  • GDI+ Kreisförmiger Ausschnitt einer Bitmap

    • name22
    • 16. April 2010 um 23:54

    Das hier ist eigentlich nur ein Beispielscript. ;)
    Es soll zeigen, wie man aus einer Bitmap (oder einem Teil davon) einen Brush erstellt.
    Die Funktion habe ich aus der GDIP.au3, welche erweiterte GDI+ Funktionen enthält.

    Morgen erstelle ich ein schöneres und übersichtlicheres Beispiel, wenn Bedarf besteht. ;)

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>

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

    $iGUIWidth = 400
    $iGUIHeight = 400
    $GUIColorBG = 0xFFFFFFFF

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

    $iX = 50 ;X-Koordinate des rechteckigen Bitmap Ausschnitts
    $iY = 50 ;Y-Koordinate des rechteckigen Bitmap Ausschnitts
    $iX2 = 100 ;X-Koordinate der Ellipse
    $iY2 = 100 ;Y-Koordinate der Ellipse
    $iWidth = 50 ;Breite des rechteckigen Bitmap Ausschnitts
    $iHeight = 50 ;Höhe des rechteckigen Bitmap Ausschnitts
    $iWidth2 = 50 ;Breite der Ellipse
    $iHeight2 = 50 ;Höhe der Ellipse

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

    $hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsClear($hGraphic, $GUIColorBG)
    _GDIPlus_GraphicsClear($hBuffer, $GUIColorBG)

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

    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Test.png")

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

    $hTextureBrush = _GDIPlus_TextureCreate2($hImage, $iX, $iY, $iWidth, $iHeight)

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

    _GDIPlus_GraphicsFillEllipse($hBuffer, $iX2, $iY2, $iWidth2, $iHeight2, $hTextureBrush)

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

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BrushDispose($hTextureBrush)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

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

    ;Die Funktionen sind nicht von mir!!
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_TextureCreate
    ; Description ...: Creates a TextureBrush object based on an image and a wrap mode
    ; Syntax.........: _GDIPlus_TextureCreate($hImage[, $iWrapMode = 0])
    ; Parameters ....: $hImage - Pointer to an Image object
    ; $iWrapMode - Wrap mode that specifies how repeated copies of an image are used to tile an area when it is
    ; +painted with the texture brush:
    ; |0 - Tiling without flipping
    ; |1 - Tiles are flipped horizontally as you move from one tile to the next in a row
    ; |2 - Tiles are flipped vertically as you move from one tile to the next in a column
    ; |3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
    ; |4 - No tiling takes place
    ; Return values .: Success - Pointer to a new TextureBrush 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 .......: The size of the brush defaults to the size of the image, so the entire image is used by the brush
    ; After you are done with the object, call _GDIPlus_BrushDispose to release the object resources
    ; Related .......: _GDIPlus_BrushDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateTexture
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_TextureCreate($hImage, $iWrapMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "hwnd", $hImage, "int", $iWrapMode, "int*", 0)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[3]
    EndFunc ;==>_GDIPlus_TextureCreate

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_TextureCreate2
    ; Description ...: Creates a TextureBrush object based on an image, a wrap mode and a defining rectangle
    ; Syntax.........: _GDIPlus_TextureCreate2($hImage, $nX, $nY, $nWidth, $nHeight[, $iWrapMode = 0])
    ; Parameters ....: $hImage - Pointer to an Image object
    ; $nX - Leftmost coordinate of the image portion to be used by this brush
    ; $nY - Uppermost coordinate of the image portion to be used by this brush
    ; $nWidth - Width of the brush and width of the image portion to be used by the brush
    ; $nHeight - Height of the brush and height of the image portion to be used by the brush
    ; $iWrapMode - Wrap mode that specifies how repeated copies of an image are used to tile an area when it is
    ; +painted with the texture brush:
    ; |0 - Tiling without flipping
    ; |1 - Tiles are flipped horizontally as you move from one tile to the next in a row
    ; |2 - Tiles are flipped vertically as you move from one tile to the next in a column
    ; |3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
    ; |4 - No tiling takes place
    ; Return values .: Success - Pointer to a new TextureBrush 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_BrushDispose to release the object resources
    ; Related .......: _GDIPlus_BrushDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateTexture2
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_TextureCreate2($hImage, $nX, $nY, $nWidth, $nHeight, $iWrapMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture2", "hwnd", $hImage, "int", $iWrapMode, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int*", 0)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[7]
    EndFunc ;==>_GDIPlus_TextureCreate2

    [/autoit]
  • Fehler: subscript used with non-array variable

    • name22
    • 16. April 2010 um 23:04
    [autoit]

    $pos = MouseGetCursor()

    [/autoit]


    Das ist Blödsinn. ;) Dieser Befehl gibt dir die Art des aktuellen Mauszeigers zurück.
    Du suchst danach:

    [autoit]

    $pos = MouseGetPos()

    [/autoit]

    Edit: Wieder mal zu langsam... :rolleyes:

  • Gui mit JPG mit mehreren Buttons

    • name22
    • 16. April 2010 um 17:36

    So wie das bei Doodle Jump gemacht wurde (GDI+) wirst du es mit Pic Controls wahrscheinlich nicht hinbekommen. ;)
    Spätestens bei Transparenz ist da nichts zu machen. :D
    Außerdem werden bei Doodle Jump nur die Koordinaten des Klicks überprüft.

  • Nur Zahlen in ein Input eingeben

    • name22
    • 15. April 2010 um 19:35

    Wieso so kompliziert? $ES_NUMBER macht genau das was er möchte. ;)

  • Nur Zahlen in ein Input eingeben

    • name22
    • 15. April 2010 um 19:32

    Benutze den Stil $ES_NUMBER oder so. :D

  • Monster - Stand: Beendet - Bugs werden sofern welche auftreten immer noch gefixt

    • name22
    • 15. April 2010 um 18:52

    So ist es aber nicht im Original. :P

  • Monster - Stand: Beendet - Bugs werden sofern welche auftreten immer noch gefixt

    • name22
    • 14. April 2010 um 22:03

    Ich habs auch mal versucht. :P

    Bilder

    • Monster1.png
      • 10,17 kB
      • 97 × 53
    • Monster2.png
      • 11,16 kB
      • 97 × 53
    • Monster3.png
      • 11,34 kB
      • 97 × 53
  • Monster - Stand: Beendet - Bugs werden sofern welche auftreten immer noch gefixt

    • name22
    • 14. April 2010 um 21:51

    Welche Bilder brauchst du denn noch? ?(
    Das nächste mal warte ich ein bisschen bevor ich unnötige Fragen stelle. :D

  • Doodle Jump für Pc

    • name22
    • 14. April 2010 um 19:03

    Ich hatte grade nichts zu tun... :)

    Bilder

    • Monster.png
      • 8,31 kB
      • 91 × 34
    • Schnee.png
      • 5,3 kB
      • 67 × 38
  • GDI+ Versuch: AnalogUhr

    • name22
    • 14. April 2010 um 18:42

    Ist ja schon recht gut geworden. :thumbup:
    Aber diese Zeile könntest du am Anfang noch einfügen ;).

    [autoit]

    _GDIPlus_GraphicsSetSmoothingMode($hBackBuffer, 2)

    [/autoit]
  • Doodle Jump für Pc

    • name22
    • 14. April 2010 um 18:23

    Hässlich 2.0 :rofl:
    Sorry ich hab es echt nicht besser hingekriegt, und im Internet finde ich nichts. :(

    Bilder

    • H
      • 38,93 kB
      • 200 × 100

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™