faustf Posted November 11, 2012 Share Posted November 11, 2012 hi guy i have a questions about this function GUICtrlCreatePic i have create a script simple only for understund how work i want have a gui whit foto and over put control and paint color rectangle but dont work , uff expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUICtrlSetResizing.au3" #include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <Date.au3> #include <GuiEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <Date.au3> #include <editconstants.au3> #include <listviewconstants.au3> #include <staticconstants.au3> #include <windowsconstants.au3> #include <guilistview.au3> #include <Word.au3> #include <GuiImageList.au3> #include <Timers.au3> #include <GuiListBox.au3> #include <GuiButton.au3> #include <ComboConstants.au3> #include <misc.au3> #include <Word.au3> #include <MPDF_UDF.au3> #include <GUIComboBox.au3> #include <Constants.au3> #include <DateTimeConstants.au3> #include <file.au3> #include <array.au3> #include <INet.au3> #include <Process.au3> #include <ColorPicker.au3> #include <WinAPI.au3> $hGUI = GUICreate("_GUICtrl_SetOnResize - Example", 700, 480) ;, -1, -1, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $Edit = GUICtrlCreateEdit("Resize only Left edge", 40, 40, 280, 200) _GUICtrl_SetOnResize($hGUI, $Edit, 10, $iGCSOR_DefCtrlMinSize, $iGCSOR_RESIZE_LEFT) ;Resize only Left edge (-1 or $iGCSOR_RESIZE_ALL to resize all) $ListView = GUICtrlCreateListView("ListView Column", 340, 40, 300, 200) GUICtrlCreateListViewItem("Item (Top + Bottom)", $ListView) _GUICtrl_SetOnResize($hGUI, $ListView, 10, $iGCSOR_DefCtrlMinSize, BitOR($iGCSOR_RESIZE_TOP, $iGCSOR_RESIZE_BOTTOM)) ;Resize Top + Bottom $Checkbox = GUICtrlCreateCheckbox("Some Checkbox (Left + Right)", 40, 270) GUICtrlSetBkColor(-1, 0xFFFFFF) _GUICtrl_SetOnResize($hGUI, $Checkbox, 10, $iGCSOR_DefCtrlMinSize, BitOR($iGCSOR_RESIZE_LEFT, $iGCSOR_RESIZE_RIGHT)) ;Resize Left + Right $Label = GUICtrlCreateLabel("Some Label (Top + Right)", 40, 320, -1, 15) GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetColor(-1, 0xFFFFFF) _GUICtrl_SetOnResize($hGUI, $Label, 10, 15, BitOR($iGCSOR_RESIZE_TOP, $iGCSOR_RESIZE_RIGHT)) ;Resize Top + Right $Button = GUICtrlCreateButton("Some Button (All corners)", 40, 370, 160, 40) _GUICtrl_SetOnResize($hGUI, $Button, 10, $iGCSOR_DefCtrlMinSize, $iGCSOR_RESIZE_ALLCORNERS) ;Resize All Corners GUISetState(@SW_SHOW, $hGUI) $Pic1 = GUICtrlCreatePic("C:\Users\Public\Pictures\Sample Pictures\winter9.jpg", 22, 47, 980, 620, $WS_CLIPSIBLINGS) ;GuiCtrlSetState(-1,$GUI_ONTOP) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button While 1 if _IsPressed(02) Then $pos = MouseGetPos() ; $Label = GUICtrlCreateLabel("",($pos[0]-350), ($pos[1]-250), -1, 15) GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetColor(-1, 0xFFFFFF) ;_GUICtrl_SetOnResize($hGUI, $Label, 10, 15, BitOR($iGCSOR_RESIZE_TOP, $iGCSOR_RESIZE_RIGHT)) ;Resize Top + Right ;MsgBox(262144, '', $pos[0] & "," & $pos[1]) $a = GUICtrlCreateGraphic(($pos[0]-350), ($pos[1]-250), 80, 80) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00) GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 20, 80, 80) $b = GUICtrlCreateGraphic(($pos[0]-300), ($pos[1]-150), 80, 20) GUICtrlSetBkColor(-1, 0xff00) exitloop EndIf WEnd EndSwitch WEnd can help me somthing thankzzz Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 12, 2012 Share Posted November 12, 2012 (edited) try $Pic1 = GUICtrlCreatePic("C:UsersPublicPicturesSample Pictureswinter9.jpg", 22, 47, 980, 620, $WS_CLIPSIBLINGS) GuiCtrlSetState(-1,128) Disabling the Picture will allow to place controls over it Edited November 12, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2012 Author Share Posted November 12, 2012 i tryed but if i try paint rectangle dont do nothing Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 12, 2012 Share Posted November 12, 2012 (edited) can you recreate your problem in a small example Im not having many UDFs present in your script Edited November 12, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 12, 2012 Share Posted November 12, 2012 This probably worksexpandcollapse popup#include-once #include <Misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> $hGUI = GUICreate("_GUICtrl_SetOnResize - Example", 700, 480, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $Edit = GUICtrlCreateEdit("Resize only Left edge", 40, 40, 280, 200) GUICtrlSetResizing(-1, 100) ;Resize only Left edge $ListView = GUICtrlCreateListView("ListView Column", 340, 40, 300, 200) GUICtrlCreateListViewItem("Item (Top + Bottom)", $ListView) GUICtrlSetResizing(-1, 6) ;Resize Top + Bottom $Checkbox = GUICtrlCreateCheckbox("Some Checkbox (Left + Right)", 40, 270) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, 96) ;Resize Left + Right $Label = GUICtrlCreateLabel("Some Label (Top + Right)", 40, 320, -1, 15) GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, 66) ;Resize Top + Right $Button = GUICtrlCreateButton("Some Button (All corners)", 40, 370, 160, 40) GUICtrlSetResizing(-1, 102) ;Resize All Corners $Pic1 = GUICtrlCreatePic(StringReplace(@AutoItExe, 'Autoit3.exe', 'ExamplesGUImsoobe.jpg'), 22, 47, 980, 620, $WS_CLIPSIBLINGS) GuiCtrlSetState(-1,128) GUISetState(@SW_SHOW, $hGUI) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $pos = MouseGetPos() $a = GUICtrlCreateGraphic(($pos[0] - 350), ($pos[1] - 250), 80, 80) GuiCtrlSetState(-1,$GUI_ONTOP) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00) GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 20, 80, 80) $b = GUICtrlCreateGraphic(($pos[0] - 300), ($pos[1] - 150), 80, 20) GuiCtrlSetState(-1,$GUI_ONTOP) GUICtrlSetBkColor(-1, 0xff00) EndSwitch WEnd My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2012 Author Share Posted November 12, 2012 i think go i try thankz for th emoment Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2012 Author Share Posted November 12, 2012 other questions but if i wanna paint a line ??? use this but dont see nothing $hPen = _GDIPlus_PenCreate() _GDIPlus_GraphicsDrawLine($hGraphic, 10, 50, 390, 150, $hPen) Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2012 Author Share Posted November 12, 2012 always over foto Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 12, 2012 Share Posted November 12, 2012 expandcollapse popup#include-once #include <Misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GDIPlus.au3> $hGUI = GUICreate("_GUICtrl_SetOnResize - Example", 700, 480, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $Pic1 = GUICtrlCreatePic(StringReplace(@AutoItExe, 'Autoit3.exe', 'ExamplesGUImsoobe.jpg'), 22, 47, 980, 620, $WS_CLIPSIBLINGS) GUICtrlSetState(-1, 128) $Edit = GUICtrlCreateEdit("Resize only Left edge", 40, 40, 280, 200) GUICtrlSetResizing(-1, 100) ;Resize only Left edge $ListView = GUICtrlCreateListView("ListView Column", 340, 40, 300, 200) GUICtrlCreateListViewItem("Item (Top + Bottom)", $ListView) GUICtrlSetResizing(-1, 6) ;Resize Top + Bottom $Checkbox = GUICtrlCreateCheckbox("Some Checkbox (Left + Right)", 40, 270) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, 96) ;Resize Left + Right $Label = GUICtrlCreateLabel("Some Label (Top + Right)", 40, 320, -1, 15) GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, 66) ;Resize Top + Right $Button = GUICtrlCreateButton("Some Button (All corners)", 40, 370, 160, 40) GUICtrlSetResizing(-1, 102) ;Resize All Corners GUISetState(@SW_SHOW, $hGUI) _GDIPlus_Startup() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $hGraphic=_GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawLine ($hGraphic, 100, 350, 600, 350) EndSwitch WEnd _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() GUIDelete() For redrawing look for GUIRegisterMsg with WM_PAINT My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. 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