Modify

Opened 11 years ago

Closed 11 years ago

#2918 closed Bug (Fixed)

GDIPlus_GetEncoderParameterList not working on Windows 8.1

Reported by: m.andreschak@… Owned by: J-Paul Mesnage
Milestone: 3.3.13.20 Component: Standard UDFs
Version: 3.3.12.0 Severity: None
Keywords: Cc:

Description

Summaration:

  • Example Script for GDIPlus_GetEncoderParameterList is not working properly.
  • DllCall insinde GDIPlus_GetEncoderParameterList does not fill the buffer supplied.
  • GDIPlus_GetEncoderParameterListSize returns correct values nevertheless.

Problem seems to not occur with windows 7.
I was only able to test Windows 7 and Windows 8.1.

#include <GDIPlus.au3>
#include <ScreenCapture.au3>

Global $hBitmap, $g_hImage, $sCLSID, $tParameter, $tParams

_GDIPlus_Startup()

; Create an image to use for paramater lists
$hBitmap = _ScreenCapture_Capture('', 0, 0, 1, 1)
$g_hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)

; Get Parameter list
$sCLSID = _GDIPlus_EncodersGetCLSID('PNG')
$tParameter = _GDIPlus_EncodersGetParamList($g_hImage, $sCLSID)
$tParams = DllStructCreate($tagGDIPPENCODERPARAMS, DllStructGetPtr($tParameter))

MsgBox(0, '', _
		'Count DllStruct:    ' & DllStructGetData($tParams, 'Count') & @LF & _
		'Count Function:    ' & _GDIPlus_EncodersGetParamListSize($g_hImage, $sCLSID))

Attachments (0)

Change History (4)

comment:1 by J-Paul Mesnage, 11 years ago

_GDIPlus_EncodersGetParamListSize does display the Count Function

My Win7 32-bit display the same as Win8.1

Last edited 11 years ago by J-Paul Mesnage (previous) (diff)

comment:2 by Eukalyptus, 11 years ago

It´s a bug in GDIPlus.au3

Function _GDIPlus_EncodersGetParamList:

Return DllStructCreate($tagGDIPPENCODERPARAMS, $tBuffer)

should be:

Return DllStructCreate($tagGDIPPENCODERPARAMS, DllStructGetPtr($tBuffer))

comment:3 by J-Paul Mesnage, 11 years ago

@Eukalyptus,
That's not OK as more than $tagGDIPENCODERPARAM can be returned.

Return $tBuffer
is better but for referencing one entry the best is

$tParams = _GDIPlus_EncodersGetParamList($g_hImage, $sCLSID)
$tParam = DllStructCreate($tagGDIPENCODERPARAM, DllStructGetPtr($tParams, 2) + ($iJ * $iParamSize))

I have a silly question is _GDIPlus_EncodersGetParamList() valid for Decoders?
Thanks for the help

comment:4 by J-Paul Mesnage, 11 years ago

Milestone: 3.3.13.20
Owner: set to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [11119] in version: 3.3.13.20

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.