how can i change the size of an image file dynamicy

M

miladhatam

i've made a dynamic website that upload an image file in image
directory with fileuploader control
and it's name was renamed and get ready to show with image control but
i have a problem
i want to change the size of image and decrease it's size
and i have another question
how can i show an image file in an image control with maintaining the
aspect ratio of that
i don't wanna the image control stretch the image
 
T

Thomas Hansen

i've made a dynamic website that upload an image file in image
directory with fileuploader control
and it's name was renamed and get ready to show with image control but
i have a problem
i want to change the size of image and decrease it's size
and i have another question
how can i show an image file in an image control with maintaining the
aspect ratio of that
i don't wanna the image control stretch the image

First of all instantiate the _original_ Image and create a
System.Drawing.Bitmap (or something equivalent).
Then you have the Width and Height of that Image.
Then multiply those numbers by e.g. 0.8 or something...
Then create a NEW System.Drawing.Bitmap with the CTOR (constructor)
taking the width and height.
Then you should be able to figure out the rest with a little help of
intellisense on the Graphics object contained in the Image (subclass to
Bitmap) class...

PS!
It sound like you also need a "dynamic image" control, one can be found
at http://ajaxwidgets.com...
(I wonder how long time it'll take till Rae tells me this is
spamming... ;)
 
M

miladhatam

thanks my friend
but in name space "system.imaging.bitmap" have no method or property
about width or height.
i am not very professional in this case
may i ask you just a bit explain that
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top