[wx-dev] mysterious wxImage::Paste() logic

Tim Kosse tim.kosse at gmx.de
Mon Sep 3 15:49:24 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vadim Zeitlin wrote:
>  Ok, I think I see what goes on here finally: this method apparently
> interprets positive x and y as coordinates in the target image (i.e. the
> one being modified) while negative coordinates are interpreted as an offset
> in the source image (the one being pasted). This seems completely crazy to
> me, especially as nothing prevents you from passing positive x and negative
> y for example. Do we really need this convention, does anybody use it? I
> hope nobody does and the function can be simplified to work only with
> positive coordinates.

Actually it's needed.

Take a piece of paper, use it as target image. Take another piece of
paper, see it as source image.

The upper left corner of the target paper are 0,0. Put the upper left
corner of the source image to coordinates x, y (think of x and y as
centimeters if you need a scale)

Glue both together

Cut the resulting image along the border of the target image.

Try x = 5cm, y = -5cm, the "paper algorithm" is basically what's
implemented in wxImage::Paste

Tim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG3I908N9+lcqiUkURAiy8AJ0dHQQEGmjkASABSQYHISoRjR+jxwCeM2TJ
LyJfe2dpgp6cgLrU6nWCS0s=
=4Bdj
-----END PGP SIGNATURE-----




More information about the wx-dev mailing list