C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

@@@@@Solve this Problem @@@@


Posted Date: 08 Oct 2008      Posted By: cnu      Member Level: Gold     Points: 1   Responses: 2



My requirement is if i upload any type of image that image i will conver in to Jpeg , I am using File upload cotrol trough this i will upload any type of image that image i will convert it Jpeg plz send me code Very Urgent




Responses

Author: Mari raj k    08 Oct 2008Member Level: SilverRating: 4 out of 54 out of 54 out of 54 out of 5     Points: 6

two ways u can achieve this,

this is the code for converting the image type

Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);

1) Save the file to the desired format in the local system first and then upload it,

or

2) Upload the file and then u convert the file as above,

Its better to save in the local system and then upload it



Author: Manindra Upadhyay    08 Oct 2008Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

use this code

System.Drawing.Image ImgPhoto = System.Drawing.Image.FromFile(imagename);
ImgPhoto.Save(Server.MapPath(FilePath) + fileName + ".jpeg", ImageFormat.Jpeg);
ImgPhoto.Dispose();



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Heading
Previous : Doubt in regrading third party control
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use