Re: Resizing a image

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thomas Parslow wrote:
> Hello,
> Does any1 know of a good way to resize an image?
> I am using a very large image which I want to fill the screen at the
> beginning, then the user would be able to zoom in on specific bits.

*last second addendum to my last post*
i fergot to mention something, a pitfall that
i often forget... (as most have noticed by now,
my memory is burnt... a result of reading a C
program once out of curiousity :)

when (if?) you use scale.e to make the image
fit onto the screen... try to remember to keep
the actual image at its full size and splendor
in memory... it would be better, as opposed to my
prior post, to keep the original image in a virtual
screen if possible, and zoom in from *that* (after
converting to whatever format scale.e wants)...
this will contradict the (easier) method in my
prior post, and creates a problem, but solves one
too...

the problem solved is repetitive image degredation as
you are always starting with the most detailed picture
possible...

the problem created is that once you take the original
image, scale it, and place it onto the screen, and then
allow the user to select a segment of the image they
want zoomed, your offsets will be all wrong...

the solution to that problem (one i can think of at least)
would be:
in the beginning, load your picture to a virtual screen,
create a temp copy in the format scale.e wants, and
scale the temp copy to a specific divisor that will allow
the image to fit onto the screen, but not necessarily
use the entire screen...

hang onto that divisor...

when the user selects a portion/segment they want zoomed,
multiply the aforementioned divisor to the coordinates
of the selection, and use those new multiplied coordinates
to select from the main virtual picture screen.

copy this new 'offset' area of the main picture to a holding
place, convert to the scale.e format, and size
that to fit the screen (or what ever zoom factor they want
to be applied to *their* segment)

this is a little cumbersome, but ensures a relatively high
zoom image quality...

--Hawke'

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu