logo       

Re: GDI+ with ctypes: msg#00035

python.ctypes

Subject: Re: GDI+ with ctypes

On Wed, 27 Oct 2004 19:05:23 +0200, Thomas Heller <theller@xxxxxxxxxx> wrote:

Florian Schulze <florian.proff.schulze@xxxxxxx> writes:

Hi!

Is it possible to access GDI+ with ctypes and if that's the case, can
someone give me a hint how to do that?

Although GDI+ is a C++ library, you can access it with ctypes. The
platform SDK has a GdiPlusFlat.h file, which contains a lot of function
definitions for C code.

A good hint.

Then, there is also a gdiplus type library for gdiplus, which I found
somewhere on the internet. The readtlb tool, included with ctypes, can
be run on this typelib to create a module containing all the enum and
structure definitions you may need. With the readtlb output piped into
a gdiplus.py module, I was able to write this code, which prints the
width and height of a jpg file:

With ctypes up to and including 0.9.1 readtlb says it can't handle multidimensional arrays, when I commented out that assert the file gets parsed, I will have to see how far I can get with that.

Your code snippet is also very helpful.

Thanks and Regards,
Florian Schulze



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise