image uploading
-
in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine
-
in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine
You can use the classes in System.Drawing and System.Drawing.Drawing2D namespaces to manipulate images. You can use System.IO.Path.GetTempFile method to create and return a unique file on disk. If you need more specific answers, please post a more specific question or problem.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: I luv teh choco The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
in my site i have form to upload image this image may be very big or very small but after user upload this image i want make some imagte prossessing as ( 1- i want to make two image from the original image 2- the first image have (50*50) cordinate 3- the secode image have (200*200) as max hight and max wiedth 4-i want for each image to take new name ) u can see example in this site http://www.blocket.se/vi/7874861.htm?ca=10\_s u can see tow image one small and one big how can do as this in my site Palestine
try something like this Stream imgStream = UploadFile.PostedFile.InputStream; int imgLen = UploadFile.PostedFile.ContentLength; string imgContentType = UploadFile.PostedFile.ContentType; string imgName = txtImgName.Value; byte[] imgBinaryData = new byte[imgLen]; int n = imgStream.Read(imgBinaryData,0,imgLen); //thumb MemoryStream stream = new MemoryStream(); System.Drawing.Image thumb = System.Drawing.Image.FromStream(imgStream); System.Drawing.Image thumbnail = thumb.GetThumbnailImage(50, 50, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero); thumbnail.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] thumbBinaryData = new byte[stream.Length]; stream.Position = 0; int m = stream.Read(thumbBinaryData, 0, (int)stream.Length); // SaveToDB(imgName, imgBinaryData, imgContentType, thumbBinaryData); Good luck :) -- modified at 8:12 Sunday 16th April, 2006