Jump to content

Jags

Active Members
  • Posts

    22
  • Joined

  • Last visited

Jags's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thats just it, It does not mark anything #include <GUIConstantsEx.au3> #include <Screencapture.au3> Opt("GUIOnEventMode", 1) Global Const $STM_SETIMAGE = 0x0172 Global Const $hGUI = GUICreate("GDI+ Test", 500, 500) Global Const $iPic = GUICtrlCreatePic("", 0, 0, 500, 500) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") _GDIPlus_Startup() $hPen = _GDIPlus_PenCreate() Local $hGDI_Bmp = _ScreenCapture_Capture("", 5,5,9,9) Local $hBmp_Captured = _GDIPlus_BitmapCreateFromHBITMAP($hGDI_Bmp) _WinAPI_DeleteObject($hGDI_Bmp) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0(500,500) Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetPixelOffsetMode($hBmpCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) _GDIPlus_GraphicsSetInterpolationMode($hBmpCtxt, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) _GDIPlus_GraphicsDrawImageRect($hBmpCtxt, $hBmp_Captured, 0, 0, 500, 500) $hGDI_Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) ;Center Square _GDIPlus_GraphicsDrawRect($hBmpCtxt, 200, 200, 100, 100,$hPen) ;Tried:=========================== ;_GDIPlus_GraphicsDrawRect($hGUI, 200, 200, 100, 100,$hPen) ;_GDIPlus_GraphicsDrawRect($iPic, 200, 200, 100, 100,$hPen) ;_GDIPlus_GraphicsDrawRect($hGDI_Bmp, 200, 200, 100, 100,$hPen) ;_GDIPlus_GraphicsDrawRect($hBmpCtxt, 5, 5, 10, 10, $hPen) ;Cleanup _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDI_Bmp)) _WinAPI_DeleteObject($hGDI_Bmp) _GDIPlus_GraphicsDispose($hBmpCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBmp_Captured) _GDIPlus_PenDispose($hPen) while 1 sleep(1000) WEnd Func Terminate() _GDIPlus_Shutdown() Exit EndFunc ;==>Terminate
  2. _GDIPlus_GraphicsDrawRect($hBmpCtxt, 200, 200, 100, 100,$hPen) Shouldn't this work to mark the center?
  3. Getting closer, Trying to get a 5x5 grid magnified 100x. This only shows 4-1/2x4-1/2, why? #include <GUIConstantsEx.au3> #include <Screencapture.au3> Opt("GUIOnEventMode", 1) Global Const $STM_SETIMAGE = 0x0172 Global Const $hGUI = GUICreate("GDI+ Test", 500, 500) Global Const $iPic = GUICtrlCreatePic("", 0, 0, 500, 500) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") _GDIPlus_Startup() Local $hGDI_Bmp = _ScreenCapture_Capture("", 5,5,9,9) Local $hBmp_Captured = _GDIPlus_BitmapCreateFromHBITMAP($hGDI_Bmp) _WinAPI_DeleteObject($hGDI_Bmp) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0(500,500) Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetInterpolationMode($hBmpCtxt, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) _GDIPlus_GraphicsDrawImageRect($hBmpCtxt, $hBmp_Captured, 0, 0, 500, 500) $hGDI_Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDI_Bmp)) _WinAPI_DeleteObject($hGDI_Bmp) _GDIPlus_GraphicsDispose($hBmpCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBmp_Captured) while 1 sleep(1000) WEnd Func Terminate() _GDIPlus_Shutdown() Exit EndFunc ;==>Terminate
  4. @Melba23, Thanks, I think I understand enough of it to incorporate into my code. @DatMCEyeBall & UEZ, I must be missing something, I couldn't get either to run.
  5. Couldn't locate anything yet, this will better show you what I'm doing. Sure there is a better than doing file read/writes every 250ms. #include <Array.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Main_Gui = GUICreate("", 110, 110, 500, 550, -1, $WS_EX_TOPMOST) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Main_Gui) $hPen = _GDIPlus_PenCreate() GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") While 1 $pos = MouseGetPos() _ScreenCapture_Capture("D:\Clip.jpg", $pos[0]-5,$pos[1]-5, $pos[0]+5,$pos[1]+5,False) $n = GUICtrlCreatePic("D:\Clip.jpg", 0, 0, 11,11) $n = GUICtrlSetPos($n, 0, 0, 110, 110) _GDIPlus_GraphicsDrawLine($hGraphic, 50, 50, 60, 50, $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, 60, 50, 60, 60, $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, 60, 60, 50, 60, $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, 50, 60, 50, 50, $hPen) Sleep(250) WEnd Func Terminate() _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc ;==>Terminate
  6. I'm looking for a way to put a small magnified section of the screen on to a Gui. I am doing this now with _ScreenCapture_Capture to a file then read the file with GUICtrlCreatePic. Is there perhaps another way to do this directly without thrashing my SSD?
  7. Duh... I thought it should but must have had some quotes misplaced when I tried. Thanks,
  8. Is it possible to have autoit evaluate a string as code? In other words msgbox(0,"Test","Hello World") could be ran as: $test ="msgbox(0," & chr(34) & "Test" & chr(34) & "," & chr(34) & "Hello World" & chr(34) & ")" RunThisStringasCode($test)
  9. Trying to make a Gui thats transparent, sizable, draggable, thin or no border and no text or other controls that would interfere with transparency. In the end I want a simple, adjustable, movable shape used to highlight certain screen areas. So far I have: $myBox = GUICreate("", 200, 300, 100, 500, BitOR($WS_SIZEBOX,$WS_SYSMENU,$WS_POPUP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) It is missing a simple drag ability and would like to remove the border. Thanks in advance,
  10. Thanks water, But, I'm very new and don't understand how to apply that solution. Maybe some more basic building blocks would help me get this on my own. For example: if $x = "This Particular Existing TreeView Item String" How do I search the tree for $x and return its location so I can add a child?
  11. Looking to build a TreeView dynamically from an Array (Array built from excel sheet) Have not made the excel sheet yet, so I'm open to suggestions on layout so as to make it easiest as possible to get it into a treeview. Thinking each row could be a item to add with the columns defining the placement in the trees, Like: Cells(1,1) = "Level 1 Parent Name" Cells(1,2) = "Level 2 Parent Name" Cells(1,3) = "Level 3 Parent Name" Cells(1,4) = "Add this item" Cells(1,5) = "" When value = "" then Create entire branch or any part of it that doesn't already exist. advance to next row For processing speed I'd probably want to work with an array, like: $aExcelData = _ExcelReadSheetToArray($oExcel,2,1,$LastUsedRow,$LastUsedCol) Can someone help me with the loop? or maybe point to tool that may do this?
  12. New to Autoit and would like to get some suggestions on how to debug. I'm missing a way to step though code, view locals, set watches etc. What do you use short of just making constant ConsoleWrite to track things?
  13. danwilli, Thanks. Your solution works too. For now I'm exploring using excel functions from autoit without writing to cells.
  14. Thanks Water. Added your Solution. Forgive a newbie but what do you mean by "Named parameters aren't supported in AutoIt"? Are you referring to Passing Arguments by Value from VBA Routines(Macros) back to Autoit?
×
×
  • Create New...