Jump to content

Search the Community

Showing results for tags '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

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 1 result

  1. 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...