XxXFaNtA Posted April 28, 2006 Share Posted April 28, 2006 Hi everone I've a small simple Question:Is there something like ImageDraw in AutoIt?For example:$pic = FileOpenDialog("Picture Source", @ScriptDir , "Pictures only (*.*)", 3)$image = ImageOpen($image)$newimage = ImageDraw($image, $x, $y, 0x0000FF)This would be quiet helpfull for making a something i'm planning /[center][/center] Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 28, 2006 Share Posted April 28, 2006 (edited) Not without using DLL Calls (GDI/GDI+). Unless you use a GUI. For example: expandcollapse popup#Include <Misc.au3>;Beta Au3 ;Starting positions Global $X = 100 Global $Y = 100 ;Picture size Global $width = 150;Width of the picture Global $height = 100;Height of the picture ;Create an empty GUI screen with no border and make it stay on top Global $PicGUI = GUICreate("A Picture Box",$width,$height,$X,$Y,$WS_POPUP,$WS_EX_TOPMOST) ;Load our picture and place it in our picture box Global $MyPic = GUICtrlCreatePic("MyPic.jpg",0,0,$width,$height) ;Alrighty, now show it: GUISetState(@SW_SHOW,$PicGUI) ;Do some stuff with it: ;If the Left Mouse button is pressed, let's move the Image down 10 pixels If (_IsPressed("01")) Then $Y += 10 WinMove("A Picture Box","",$X,$Y) ;If the MiddleMouse button is pressed, let's move the image to the left 10 pixels ElseIf (_IsPressed("04")) Then $X += 10 WinMove("A Picture Box","",$X,$Y) EndIf ;If a certain window is open, let's hide the picture, otherwise show it: If (WinExists("AutoIt Help")) Then GUISetState(@SW_HIDE,$PicGUI) Else GUISetState(@SW_SHOW,$PicGUI) EndIf ;Alrighty, we are done, let's get rid of it: GUIDelete($PicGUI) Seems like alot of code for something simple, but I guess that's the way it goes sometimes. -CMR [EDIT] Just so you know, the Misc.au3 is only there for the _IsPressed() function. You could use HotKeySet with the same results, just tacks on more code and HotKeys tend to... take control...[/EDIT] Edited April 28, 2006 by CodeMaster Rapture Link to comment Share on other sites More sharing options...
XxXFaNtA Posted April 28, 2006 Author Share Posted April 28, 2006 (edited) hm...i'll try this... but there's one small problem: I need the same Picture with the changes saved as a picture (*.jpg,*.bmp,...). I have no problems using a DLL, but i don't know how to make a DllCall ^^ Edit: in your code, neither $WS_POPUP nor $WS_EX_TOPMOST is declared Edited April 28, 2006 by XxXFaNtA /[center][/center] Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 28, 2006 Share Posted April 28, 2006 Hmm, So you want to load a picture, modify it, display it, and save it? Link to comment Share on other sites More sharing options...
XxXFaNtA Posted April 28, 2006 Author Share Posted April 28, 2006 (edited) Load Picture Modify it Save it It doesn't have to be displayed Edited April 28, 2006 by XxXFaNtA /[center][/center] Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 28, 2006 Share Posted April 28, 2006 Hrm... Sounds easy enough, but I don't think AutoIt currently has any built-in functions for that kind of work unless you can use FileOpen/Close and write to it that way. Altho, I'm not sure how it would turn out. Link to comment Share on other sites More sharing options...
XxXFaNtA Posted April 28, 2006 Author Share Posted April 28, 2006 hm...ooh this would be sweet for the next beta /[center][/center] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now