PDA

View Full Version : بدست خصوصیات یه عکس



rozita
چهارشنبه 13 خرداد 1383, 19:28 عصر
سلام
1- چه جوری میشه مشخصات یه عکس که کاربران Upload میکنند مثل طول و عرض و ... را در ASP.NET بدست آورد ؟
2- من شنیدم یه سری تابع هست که میشه با اونها طول و عرض عکس را
تغییر داد " برای وب " تو NetFramework . کلاسی برای این کار هست ؟ :oops:

Farhad.B.S
چهارشنبه 13 خرداد 1383, 21:00 عصر
1.

System.Drawing.Image.FromFile("ImagePath").Width

2.
http://www.bobpowell.net/changing_resolution.htm

rozita
پنج شنبه 14 خرداد 1383, 10:06 صبح
سلام
با Error زیر مواجه شدم :

Out of memory.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Out of memory.
</span>

sanaz_amiri
پنج شنبه 14 خرداد 1383, 15:45 عصر
سلام
من فکر کنم این به خاطر اینکه name space رو معرفی نکردی

rozita
پنج شنبه 14 خرداد 1383, 22:37 عصر
با این کد مشکل حل میشه ( اون خطا ربطی به NameSpace نداشت )
Dim objStream as Stream = inputPhotoUpload.PostedFile.InputStream
Dim objImage as System.Drawing.Image = System.Drawing.Image.FromStream(objStream)

'assign photo height
dim OriginalPhotoHeight as integer
OriginalPhotoHeight = objImage.Height

'assign photo width
dim OriginalPhotoWidth as integer
OriginalPhotoWidth = objImage.Width