Modify

Opened 11 years ago

Closed 11 years ago

#2748 closed Bug (Fixed)

_WinAPI_SaveHBITMAPToFile in WinAPIGdi.au3 is bugged

Reported by: anonymous Owned by: guinness
Milestone: 3.3.13.0 Component: AutoIt
Version: 3.3.12.0 Severity: None
Keywords: bitmap file Cc:

Description

_WinAPI_SaveHBITMAPToFile may break as reported by SciTE's console:

"C:\Program Files (x86)\AutoIt3\Include\WinAPIGdi.au3" (3702) : ==> Variable used without being declared.:
_WinAPI_CloseHandle($hFile)
_WinAPI_CloseHandle( ERROR

That is because the declaration of variable $hFile is now within a loop (line 3683), which may or may not be executed, while the variable is still being used outside that loop.

Furthermore, it is not saving the bitmap in many situations, failing at line 3616 (_WinAPI_DrawBitmap). Apparently, a false report, because if one forces the assignment "$hBitmap = $hSource", regardless of the status returned by _WinAPI_DrawBitmap, the bitmap is saved correctly.

As a last consideration, the example found at the help file page for _WinAPI_SaveHBITMAPToFile fails when run, saving a bitmap which turns out to be just a block painted in black.

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by lcofresi

The problem with the second part of the complaint (or at least with part of it) is in the _WinAPI_DrawBitmap() function.

The line 1431, at the end of the function reads

If Not $iError Then Return SetError(10, 0, 0)

It should be of course

If $iError Then Return SetError(10, 0, 0)

comment:2 Changed 11 years ago by guinness

  • Milestone set to 3.3.13.0
  • Owner set to guinness
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [10211] in version: 3.3.13.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain guinness.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.