More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Khalid's spaceProfileFriendsBlog Tools Explore the Spaces community

Khalid's space

This friends list is empty.

July 11

My first diving video

I had my first diving session in Jeddah, Saudi Arabia. It was REALLY fun. Check it out http://www.youtube.com/watch?v=dXZAWfYenNs 
June 22

Becoming a TOGAF Enterprize Architecht

Two Weeks ago I attended a workshop about The Open Group Architectural Framework (TOGAF) at London. The workshop was really different and I would say ... interesting. I passed the evaluation, and now I am a TOGAF Certified Enterprise Architect  Smile
December 23

How to interface with IBM WebSphere MQ from .NET

I just published a paper about interfacing with IBM WebSphere MQ from .NET on "The Code Project" check it out, and tell me what you think. I got pretty good reviews so far ;)
 
Khalid Al-Hadlaq

.NET image conversion facility

I am currently working on a project, and among the things that I wanted to implement is the ability to convert any uploaded file into JPEG files to reduce files' size. After a little research, I found how easy was it to achieve this in .NET 2.0. The below code snippet will provide the core part, and definitely you can play with the properties to tailor it for your needs.

 

// specify the source file

FileStream fs = new FileStream([Source File Path], FileMode.Open);

// load stream into an Image object

System.Drawing.Image SourceImage = Bitmap.FromStream(fs);

// specify where you would like to store the converted file

// ImageFormat class has a variety of image option like PNG, TIFF, GIF, etc

SourceImage.Save([Target file path], ImageFormat.Jpeg);

// close the stream to release the used resources

fs.Close();