[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image transformations

From: Eli Zaretskii
Subject: Re: Image transformations
Date: Wed, 26 Jun 2019 18:34:00 +0300

> Date: Wed, 26 Jun 2019 09:28:17 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> Cc: Stefan Monnier <address@hidden>,
>       address@hidden
> First, I couldn't find any Windows GDI API that deals with affine
> transformation matrices directly.

The GDI API which uses the matrices directly is SetWorldTransform, see


I eventually decided not to use it, because when I tried, it displayed
a slightly stretched image even with a trivial matrix, i.e. no
transform at all.  Also, the more general description of the topic,
which you can find here:


and the examples here:


did not tell enough detail nor show enough examples for me to be sure
I really understand the subject.  So I'm using PlgBlt instead.  But I
still want to keep compatibility with the transform matrices as
defined in the documentation of SetWorldTransform, and I'm using the
equations shown there to produce the coordinates that PlgBlt needs.
This will allow to use SetWorldTransform in the future if we want to
(assuming someone will understand why it didn't work for me to be gin

> Guessing from its API design, I think GDI does not internally perform
> any (real-valued) matrix calculations, but uses some variant of
> Bresenham's line algorithm for image transformations to prefer integer
> arithmetics.

I think the fact that SetWorldTransform exists contradicts this
conclusion.  The matrix is defined as an array of floats.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]