Jump to content

Search the Community

Showing results for tags 'PNG remove destroy'.



More search options

  • 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


Location


WWW


Interests

Found 1 result

  1. Task: Display a PNG, and remove it on command. I searched and read the help file for some time. I came up with a solution but that was not nice (was something like fill the previous image with the backgroundcolor...) So I re-used the example of the PNG display (with a little mod) and ask kindly if someone could give me a hint on the _remove() function. I think there is a easier method or isn't there one? I attached the images but I think it does not matter just use any png files._png.zip #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> Global $hGUI, $hImage, $hGraphic, $hImage1 ; Create GUI $hGUI = GUICreate("Show PNG", 500, 500) ; Load PNG image _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile("big.png") $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $button1=GUICtrlCreateButton("change",400,20,100,20) $button2=GUICtrlCreateButton("remove",400,50,100,20) GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop case $button1 _change() case $button2 _remove() EndSwitch WEnd ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() func _remove() ;~ mmmh EndFunc func _change() $hImage = _GDIPlus_ImageLoadFromFile("small.png") _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hImage, 0, 0,300,300,0,0,300,300) EndFunc ; Draw PNG image Func MY_WM_PAINT($hWnd, $msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hImage, 0, 0,300,300,0,0,300,300) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_PAINT
×
×
  • Create New...