PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

how to scale an image

akabeer1983 · 03 Feb 2009, 06:35 UTC
Hi,
i am programming for iPhone, i want to scale an image, based on user's touch (touch one corner of image and drag it).
how can i scale the image.
i tried the following, but it displays nothing:

//member variables declaration part
E2DBLTFX bltfx;

//constructor
bltfx.xscale = 3;
bltfx.yscale = 3;

//OnNextFrame function
display -> BltFx(10, 10, image, ▭, &bltfx;);


But there wsa no problem with rendering the image normally:
display -> BltFast(100, 100, image, ▭)
the above statement displays the image properly.
Hi,

Your scale values are too small, which makes the image invisible. To scale, use the following formula's:

Code:

bltfx.xscale = 3 * 65536; //300%
bltfx.xscale = 65536 / 2; //50%
akabeer1983 · 03 Feb 2009, 07:43 UTC
i also tried the following, but nothing dislayed;
display -> Blt(0, 0, image, ▭, 0, 65536, EFLIP_HORIZONTAL);
i also tried various other values for rotation, sclaing, but in vain.
akabeer1983 · 03 Feb 2009, 07:46 UTC
Hi,
thanks for reply
it worked with:
bltfx.xscale = 3 * 65536;// (300%)
for both Blt and Btlfx functions.
Thanks