Modify

Opened 10 years ago

Closed 10 years ago

#2918 closed Bug (Fixed)

GDIPlus_GetEncoderParameterList not working on Windows 8.1

Reported by: m.andreschak@… Owned by: Jpm
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 Changed 10 years ago by Jpm

_GDIPlus_EncodersGetParamListSize does display the Count Function

Version 0, edited 10 years ago by Jpm (next)

comment:2 Changed 10 years ago by Eukalyptus

It´s a bug in GDIPlus.au3

Function _GDIPlus_EncodersGetParamList:

Return DllStructCreate($tagGDIPPENCODERPARAMS, $tBuffer)

should be:

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

comment:3 Changed 10 years ago by Jpm

@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 Changed 10 years ago by Jpm

  • Milestone set to 3.3.13.20
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [11119] in version: 3.3.13.20

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 Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.