Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 11:53

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



GDI+ Script Problem

Discussion on GDI+ Script Problem within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2014
Posts: 4
Received Thanks: 0
Question GDI+ Script Problem

Moin Moin ersma ^^

ich habe hier ein kleines Problem mit meinem Script. Ich wollte mir ein kleines Programm basteln (wird dann als kleiner Bildschirmschoner verwendet), das mittels GDI+ andauernd Linien zeichnet, bis die vorher definierte "Zeitvariable" (mehr so ein Zähler) mit dem ausgerechnetem Wert übereinstimmt, dann sollten alle Linien gelöscht werden, und alles von vorne beginnen, bis ich irgendwann das Programm beende. Allerdings wenn ich es starte, kommt nur die GUI und nichts passiert, bis ich ESC drücke. Script folgt unten und ich bedanke mich schonmal im vorraus für Hilfe

Code:
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
Local $DrawGUI, $hGraphic, $hPen
$DESKTOPHEIGHT= @DesktopHeight
$DESKTOPWIDTH= @DesktopWidth
$Time0= 0
$Time1= 1
$Time2= 0
$TimeDraw= Random ( 1, 500 )
$DrawGUI = GUICreate("DRAW", $DESKTOPWIDTH, $DESKTOPHEIGHT)
GUISetState(@SW_SHOW)
While 1
   Switch GUIGetMsg()
	  Case $GUI_EVENT_CLOSE
		 Exit
   EndSwitch
   $Rand0 = Random ( $DESKTOPHEIGHT, $DESKTOPWIDTH )
   $Rand1 = Random ( $DESKTOPHEIGHT, $DESKTOPWIDTH )
   $Rand2 = Random ( $DESKTOPHEIGHT, $DESKTOPWIDTH )
   $Rand3 = Random ( $DESKTOPHEIGHT, $DESKTOPWIDTH )
   _GDIPlus_Startup()
   $hGraphic = _GDIPlus_GraphicsCreateFromHWND($DrawGUI)
   $hPen = _GDIPlus_PenCreate()
   _GDIPlus_GraphicsDrawLine($hGraphic, $Rand0, $Rand1, $Rand2, $Rand3, $hPen)
   _GDIPlus_Shutdown()
   $Time2 = $Time0 + $Time1
   $Time2 = $Time0
   If $Time0 = $TimeDraw Then
	  _GDIPlus_GraphicsClear ( $hGraphic )
	  _GDIPlus_GraphicsDispose($hGraphic)
	  _GDIPlus_PenDispose($hPen)
	  $TimeDraw= Random ( 1, 500 )
   EndIf
WEnd
ByteCatcher is offline  
Old 03/20/2014, 14:34   #2
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
versuchs mal so:
Code:
#include <GDIPlus.au3>
Global $DrawGUI, $hGraphic, $hPen, $time, $TimeDraw = Random (1, 500, 1)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND(GUICreate("DRAW", @DesktopWidth, @DesktopHeight, 0, 0, 0x90000000))

While True
	If GUIGetMsg()=-3 Then
		_GDIPlus_Shutdown()
		Exit
	EndIf
	_GDIPlus_GraphicsDrawLine($hGraphic, Random(0, @DesktopWidth, 1), Random(0, @DesktopHeight, 1), Random(0, @DesktopWidth, 1), Random(0, @DesktopHeight, 1))
	$time += 1
	If $time >= $TimeDraw Then
		_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
		$time=0
		$TimeDraw= Random (1, 500, 1)
	EndIf
WEnd
lolkop is offline  
Thanks
1 User
Old 03/20/2014, 14:35   #3
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
Es könnte daran liegen das du innerhalb der while schleife andauernd GDI+ initialisiert und wieder beendest.
Croco™ is offline  
Thanks
1 User
Old 03/20/2014, 14:49   #4
 
elite*gold: 0
Join Date: Mar 2014
Posts: 4
Received Thanks: 0
Danke an Lolkop, funzt jetze ^^
ByteCatcher is offline  
Reply

Tags
gdi+, problem


Similar Threads Similar Threads
HP Script Problem
09/24/2011 - Metin2 Private Server - 2 Replies
Also hab nochn älteres Hp Script.. Und wollte mal fragen, was ich umstellen muss, damit das Kästchen nicht leer bleibt? http://h3.abload.de/img/catsueke.jpg Darunter ist dann noch ein 2. Wo was drin steht, wenn ich aber z.b das 1 Oben löschen will, lässt es sich nicht wirklich löschen, weil die Ränder immer da bleiben ect, oder der Platz bleibt frei blabla.. Was genau muss ich in der Index ändern das da ein Bild drin ist oder sonst was?
Hen Script Problem... -.-
11/04/2010 - Metin2 Private Server - 12 Replies
Joa hallo Leute, mich plagt seid dem ich das Script eine doofe Fehlermeldung die das Script zum absturz bringt <.< Man kann sich nicht mehr registieren, man kann sich einloggen aber nicht mehr in den Itemshop oder in andere Kategorien, es wird dann angezeigt man solle sich erst einloggen. Hier mal die Fehlermeldung: Warning: session_start() : Cannot send session cookie - headers already sent by (output started at C:\xampplite\htdocs\index.php:7) in C:\xampplite\htdocs\index.php on...
Problem VB 10 Patcher Script Problem
09/20/2010 - .NET Languages - 8 Replies
Hayho liebe Com. ich habe mal wieder einen ganz netten Patcher gescriptet, für einen metin2 P Server, da es nicht mein erster is, hab ich echt kp was da vorliegt, Hier der Script an sich: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles...
[HOW-TO]Hp-Script+Admin-script (weekly-updatet) problem!
06/21/2010 - Metin2 Private Server - 11 Replies
hallo leute ich hab ein problem und zwar bei dem hp script von masterboss kommt der fehler : http://img541.imageshack.us/img541/8140/24955249. png und wenn ich dann die datei öffne und in die zeile gehe kommt: while($row = mysql_fetch_array($ergebnis)) kann mir jmd helfen?
Script problem
06/10/2010 - AutoIt - 2 Replies
hi.. ich wollte mir nen bot für nostale schreiben... doch i.wo haperts da bei mir bzw autoit will das ding nich so wirklich ausführen und gibt mir folgenden fehler: Er sagt:Variable used without being declared ( zeile 49) deutsch: Variable verwendet, ohne dass erklärt hier mal mein script: Hoffe mir kann jmd hfeln...



All times are GMT +1. The time now is 11:53.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.