Biete mich als Hilfe an [Coding][Au3]

07/03/2013 16:19 Achat#16
[Only registered and activated users can see links. Click Here To Register...]

MfG
07/03/2013 16:33 Fl00d3R#17
Quote:
Originally Posted by Achat View Post
[Only registered and activated users can see links. Click Here To Register...]

MfG
Kannst ja per Mousedown und Mouseup die beiden Koordinaten erhalten.
Das Quadrat kannst du mittels GDI+ zeichnen:
_GDIPlus_GraphicsFillRect([Only registered and activated users can see links. Click Here To Register...],100,100,200,200,[Only registered and activated users can see links. Click Here To Register...])


LG Fl00d3R
07/04/2013 11:46 Achat#18
Quote:
Originally Posted by Fl00d3R View Post
Kannst ja per Mousedown und Mouseup die beiden Koordinaten erhalten.
Das Quadrat kannst du mittels GDI+ zeichnen:
_GDIPlus_GraphicsFillRect([Only registered and activated users can see links. Click Here To Register...],100,100,200,200,[Only registered and activated users can see links. Click Here To Register...])


LG Fl00d3R
Nette Farben, hast du dafür ein Programm?

Code:
#include <GDIplus.au3>
#include <WinApi.au3>
#include <Misc.au3>

$hDLLUser32 = DllOpen('user32.dll')

_GDIPlus_Startup()

OnAutoItExitRegister('_OnExit')

Func _OnExit()
	DllClose($hDLLUser32)
	_GDIPlus_Shutdown()
EndFunc   ;==>_OnExit

Dim $iXStart = 0, $iYStart = 0, $iXEnd, $iYEnd
While 1
	If _IsPressed(01, $hDLLUser32) Then
;~ 		If Not $iXStart + $iYStart Then
		$iXStart = MouseGetPos(0)
		ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iXStart = ' & $iXStart & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
		$iYStart = MouseGetPos(1)
		ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iYStart = ' & $iYStart & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
;~ 		EndIf
	EndIf
	$iXEnd = MouseGetPos(0)
	$iYEnd = MouseGetPos(1)
;~ 	_DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYStart - $iYEnd)
	_DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYEnd - $iYStart)
;~ 	If $iXStart+$iYStart Then _DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYEnd - $iYStart)
;~ 	$iXStart = 0
;~ 	$iYStart = 0
	Sleep(10)
WEnd

Func _DrawRect($iX, $iY, $iWidth, $iHeight)
	Local $hGraphic, $hBrush
	$hGraphic = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
;~ 	$hBrush = _GDIPlus_BrushCreateSolid(0x33000000)
	$hPen = _GDIPlus_PenCreate(0xFF0000FF)
;~ 	_GDIPlus_GraphicsFillRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hBrush)
	_GDIPlus_GraphicsDrawRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hPen)
	_GDIPlus_GraphicsDispose($hGraphic)
	_GDIPlus_BrushDispose($hBrush)
	_GDIPlus_PenDispose($hPen)
EndFunc   ;==>_DrawRect
Irgendwie funktioniert das nicht so, wie ich es mir vorgestellt habe (wie beim SnippingTool)

MfG
07/04/2013 14:02 Fl00d3R#19
Quote:
Originally Posted by Achat View Post
Nette Farben, hast du dafür ein Programm?

Code:
#include <GDIplus.au3>
#include <WinApi.au3>
#include <Misc.au3>

$hDLLUser32 = DllOpen('user32.dll')

_GDIPlus_Startup()

OnAutoItExitRegister('_OnExit')

Func _OnExit()
    DllClose($hDLLUser32)
    _GDIPlus_Shutdown()
EndFunc   ;==>_OnExit

Dim $iXStart = 0, $iYStart = 0, $iXEnd, $iYEnd
While 1
    If _IsPressed(01, $hDLLUser32) Then
;~         If Not $iXStart + $iYStart Then
        $iXStart = MouseGetPos(0)
        ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iXStart = ' & $iXStart & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
        $iYStart = MouseGetPos(1)
        ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iYStart = ' & $iYStart & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
;~         EndIf
    EndIf
    $iXEnd = MouseGetPos(0)
    $iYEnd = MouseGetPos(1)
;~     _DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYStart - $iYEnd)
    _DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYEnd - $iYStart)
;~     If $iXStart+$iYStart Then _DrawRect($iXStart, $iYStart, $iXEnd - $iXStart, $iYEnd - $iYStart)
;~     $iXStart = 0
;~     $iYStart = 0
    Sleep(10)
WEnd

Func _DrawRect($iX, $iY, $iWidth, $iHeight)
    Local $hGraphic, $hBrush
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
;~     $hBrush = _GDIPlus_BrushCreateSolid(0x33000000)
    $hPen = _GDIPlus_PenCreate(0xFF0000FF)
;~     _GDIPlus_GraphicsFillRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hBrush)
    _GDIPlus_GraphicsDrawRect($hGraphic, $iX, $iY, $iWidth, $iHeight, $hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
EndFunc   ;==>_DrawRect
Irgendwie funktioniert das nicht so, wie ich es mir vorgestellt habe (wie beim SnippingTool)

MfG
Wäre Sinnvoll, wenn du mir sagen würdest, was du genau haben möchtest.

LG
07/04/2013 14:14 Achat#20
Quote:
Originally Posted by Fl00d3R View Post
Wäre Sinnvoll, wenn du mir sagen würdest, was du genau haben möchtest.

LG
Quote:
Originally Posted by Achat View Post
[Only registered and activated users can see links. Click Here To Register...]

MfG
Ein Rechteck zeichnen, wie beim Snipping Tool. (Zu finden unter C:\Windows\System32\SnippingTool.exe)

Bei meinem Code wird mehr als ein Rechteck gezeichnet ._.

[Only registered and activated users can see links. Click Here To Register...]

bzw das alte wird nicht "gelöscht"

MfG
07/18/2013 18:56 Fl00d3R#21
Push
07/18/2013 19:08 omer36#22
Quote:
Originally Posted by Fl00d3R View Post
Push
Quote:
Originally Posted by Achat View Post
Ein Rechteck zeichnen, wie beim Snipping Tool. (Zu finden unter C:\Windows\System32\SnippingTool.exe)

Bei meinem Code wird mehr als ein Rechteck gezeichnet ._.

[Only registered and activated users can see links. Click Here To Register...]

bzw das alte wird nicht "gelöscht"

MfG


schon ne lösung gefunden? ^^
07/18/2013 19:11 c0w#23
Also erst mal op thx weil für die menge an seiten nur ein thank ist ne frechheit eigentlich. Und dann abonier ich mal und komm drauf zurück wenn ich am pc bin :-D
07/19/2013 02:30 Shadow992#24
Quote:
Originally Posted by omer36 View Post
schon ne lösung gefunden? ^^
Ganz einfach das Ganze muss zuerst in einen Zwischenbuffer gezeichnet werden und kann dann erst rausgezeichnet werden.

Habe hier einmal einfach C&P mit ein paar Kürzungen aus meiner GameEngine genommen:

Einmal am Anfang:

PHP Code:
_GDIPlus_Startup()
    
Local $hDC _WinAPI_GetWindowDC($hGUI)
    
$_ShadowEngine_hGraphic _GDIPlus_GraphicsCreateFromHDC($hDC)
    
$_ShadowEngine_hBitmap _GDIPlus_BitmapCreateFromGraphics($w$h$_ShadowEngine_hGraphic)
    
$_ShadowEngine_hBackbuffer _GDIPlus_ImageGetGraphicsContext($_ShadowEngine_hBitmap
Vor jedem Zeichnen muss der Buffer gecleart werden:
PHP Code:
_GDIPlus_GraphicsClear($_ShadowEngine_hBackbuffer$color
Jetzt zeichnet man ganz normal seine Objekte in den Buffer:
PHP Code:
_GDIPlus_GraphicsDrawImageRect($_ShadowEngine_hBackbuffer$_ShadowEngine_Objects[$i][4], $_ShadowEngine_Objects[$i][0], $_ShadowEngine_Objects[$i][1], $_ShadowEngine_Objects[$i][2], $_ShadowEngine_Objects[$i][3]) 
Die Änderungen werden dann so übernommen:

PHP Code:
_GDIPlus_GraphicsDrawImageRect($_ShadowEngine_hGraphic$_ShadowEngine_hBitmap$_ShadowEngine_X$_ShadowEngine_Y$_ShadowEngine_W$_ShadowEngine_H
07/24/2013 17:24 Fl00d3R#25
Push
08/02/2013 18:52 Fl00d3R#26
Push
08/02/2013 19:43 Virus.bat#27
Quote:
Originally Posted by Fl00d3R View Post
Push
The Reason?
Der Grund?
08/02/2013 19:45 Fl00d3R#28
das der Thread wieder nach vorne rutscht.

lg Fl00d3R
08/02/2013 19:56 Virus.bat#29
Quote:
Originally Posted by Fl00d3R View Post
das der Thread wieder nach vorne rutscht.

lg Fl00d3R
Wi brauchen diesen thread aber nicht wofur habn wir diese section :o und soweit ich weiß ist pushen nicht erlaubt..:D hope you enjoy x3
08/02/2013 20:43 _RowLegend_#30
Quote:
Originally Posted by Virus.bat View Post
Wi brauchen diesen thread aber nicht wofur habn wir diese section :o und soweit ich weiß ist pushen nicht erlaubt..:D hope you enjoy x3
Scheiße schreiben ist auch nicht erlaubt, aber du machst es trotzdem.