Jump to content

Search the Community

Showing results for tags '_WinAPI_BitBlt'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. in the help is something similar to what i want to do but instead of screen capture i want to cut a rectangular chunk out of an image, _GDIPlus_GraphicsDrawImage() let me dwaw the image where i want on the x y coordinates but i want to copy a certain Width and Height from a custom X and Y coordinate. i went to look at ScreenCapture.au3 seems that _WinAPI_BitBlt does the job but i don't understand it, is there a simple way staying with _GDIPlus_Graphics? or any tips on how to do it with _WinAPI_BitBlt ? help file example #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Example() Func Example() Local $hBitmap1, $hBitmap2, $hImage1, $hImage2, $hGraphic ; Initialize GDI+ library _GDIPlus_Startup() ; Capture full screen $hBitmap1 = _ScreenCapture_Capture("") $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1) ; Capture screen region $hBitmap2 = _ScreenCapture_Capture("", 0, 0, 400, 300) $hImage2 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap2) ; Draw one image in another $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage2, 100, 100) ; Draw a frame around the inserted image _GDIPlus_GraphicsDrawRect($hGraphic, 100, 100, 400, 300) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage1, @MyDocumentsDir & "\GDIPlus_Image.jpg") ; Clean up resources _GDIPlus_ImageDispose($hImage1) _GDIPlus_ImageDispose($hImage2) _WinAPI_DeleteObject($hBitmap1) _WinAPI_DeleteObject($hBitmap2) ; Shut down GDI+ library _GDIPlus_Shutdown() ShellExecute(@MyDocumentsDir & "\GDIPlus_Image.jpg") EndFunc ;==>Example
  2. I'm coding a GUI that using a lot of GDI (not GDI+) output. I've been manually redrawing things as needed via WM_PAINT. It's awkward and slow, and it can flicker a lot. Then I found out about _WinAPI_BitBlt. I've looked all over the forums here, and all over the internet in general. I think I understand the basics of it, but I can't get it to work. I think what I want to do is manipulate $hDCSource and then BitBlt it onto $hDCDest. Here's my reducer sample: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $Width = 100, $Height = 100 Global $Left = 50, $Top = 50 Global $hwnd, $hDCDest, $hDCSource, $hPenLil, $hPenFat, $hBrush Main() Func Main() ; GUI & GDI handles $hwnd = GUICreate("BitBlt Test", 300, 300) $hDCDest = _WinAPI_GetDC($hwnd) $hDCSource = _WinAPI_CreateCompatibleDC($hDCDest) $hPenLil = _WinAPI_CreatePen($PS_SOLID, 1, 0xFFFFFF) $hPenFat = _WinAPI_CreatePen($PS_SOLID, 3, 0x00FF00) $hBrush = _WinAPI_CreateSolidBrush(0xFFFFFF) ; Fill white rectangle Local $tRect = DllStructCreate($tagRect) DllStructSetData($tRect, "Left", $Left) DllStructSetData($tRect, "Top", $Top) DllStructSetData($tRect, "Right", $Left + $Width) DllStructSetData($tRect, "Bottom", $Top + $Height) _WinAPI_FillRect($hDCSource, $tRect, $hBrush) ; Thick green outline _WinAPI_SelectObject($hDCSource, $hPenFat) _WinAPI_MoveTo($hDCSource, $Left, $Top) _WinAPI_LineTo($hDCSource, $Left + $Width, $Top) _WinAPI_LineTo($hDCSource, $Left + $Width, $Top + $Height) _WinAPI_LineTo($hDCSource, $Left, $Top + $Height) _WinAPI_LineTo($hDCSource, $Left, $Top) ; Thin black outline _WinAPI_SelectObject($hDCSource, $hPenLil) _WinAPI_MoveTo($hDCSource, $Left, $Top) _WinAPI_LineTo($hDCSource, $Left + $Width, $Top) _WinAPI_LineTo($hDCSource, $Left + $Width, $Top + $Height) _WinAPI_LineTo($hDCSource, $Left, $Top + $Height) _WinAPI_LineTo($hDCSource, $Left, $Top) GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUISetState(@SW_SHOW, $hwnd) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Quit() EndSwitch WEnd EndFunc Func WM_PAINT() ; _WinAPI_BitBlt($hDCDest, $Left, $Top, $Width, $Height, $hDCSource, $Left, $Top, $BLACKNESS) ; Works _WinAPI_BitBlt($hDCDest, $Left, $Top, $Width, $Height, $hDCSource, $Left, $Top, $SRCCOPY) ; Doesn't work EndFunc Func Quit() _WinAPI_ReleaseDC($hwnd, $hDCDest) _WinAPI_DeleteDC($hDCSource) _WinAPI_DeleteObject($hBrush) _WinAPI_DeleteObject($hPenLil) _WinAPI_DeleteObject($hPenFat) GUIDelete($hwnd) Exit EndFunc What am I doing wrong?
×
×
  • Create New...