S
Stimp
I've been hacking at this for 15 mins, but haven't really got too much
time to spend on it today, so maybe someone here can suggest a quick
fix or suggest if there is a function built into asp.net that I could
look at...
Say I have an image that's 600 x 480 pixels and I want to create a new
image which is cropped from this image to something like 100 x 80
pixels.
The only problem is that the new image must show the full width of the
original image, plus the image should be centered height-wise (i.e.
cropping off the top and bottom of the original image)
Essentially I have 2 rectangles, one for the src image and the other for
the output image.
Using the above example, the output image rectangle is:
(0, 0, 100, 80) - creates an image 100 x 80 pixels, starting at 0,0
and so far I've got the following for the src rectangle:
(0, iSrcY , imgOrig.Width, iSrcHeight)
The values I need here are: iSrcY (the starting point on the y-axis)
iSrcHeight (the height of the source image to take)
these would be calculated using a ratio derived from the size
of the destination image i.e. 100 x 80
Any ideas, or is there an asp.net transformation function built in that
I can use?
Thanks!
time to spend on it today, so maybe someone here can suggest a quick
fix or suggest if there is a function built into asp.net that I could
look at...
Say I have an image that's 600 x 480 pixels and I want to create a new
image which is cropped from this image to something like 100 x 80
pixels.
The only problem is that the new image must show the full width of the
original image, plus the image should be centered height-wise (i.e.
cropping off the top and bottom of the original image)
Essentially I have 2 rectangles, one for the src image and the other for
the output image.
Using the above example, the output image rectangle is:
(0, 0, 100, 80) - creates an image 100 x 80 pixels, starting at 0,0
and so far I've got the following for the src rectangle:
(0, iSrcY , imgOrig.Width, iSrcHeight)
The values I need here are: iSrcY (the starting point on the y-axis)
iSrcHeight (the height of the source image to take)
these would be calculated using a ratio derived from the size
of the destination image i.e. 100 x 80
Any ideas, or is there an asp.net transformation function built in that
I can use?
Thanks!