Groups > Asp .Net > Getting started with ASP.NET > resize an image




Re: resize an image

Re: resize an image
Thu, 3 Apr 2008 15:32:52 +0000
Hey Hi,

i little confused with what your final requriment is.....sorry a little slow
here(LOL)............but the following code might give a idea.........what this
does is bascially resizes the image with loosing the original properites
..............hope this helps you........

 

string pathFile = Server.MapPath("~/images/image1.tiff");
        Image _OldImage = Image.FromFile(pathFile);
        Image _Image = new Bitmap(800, 600, _OldImage.PixelFormat);

        using (Graphics _Graphics = Graphics.FromImage(_Image))
        {
            _Graphics.DrawImage(_OldImage, 0, 0, _Image.Width, _Image.Height);
        }
        _Image.Save("pathFile", _OldImage.RawFormat);
        _Image.Dispose();
        _OldImage.Dispose(); Thanks....
Post Reply
resize an image
Thu, 3 Apr 2008 16:12:25 +0000
I have a tiff image that is 8.5 by 11 inch tiff  the width dpi is 203 dpi, the y
dpi is 98 which gives me a 1728 x 1072 tiff image

 When i pass the original tiff image to a pdf writer i get a 1728, 1072 pdf
which is unreadable.  

 How do I convert the image so that it is 8.5 by 11 image with the same dpi on
both axis?
Post Reply
about | contact