Archives
December 2009 M T W T F S S « May 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Category Cloud
This document explores the potential of Windows Presentation Foundation on the Web. In addition, it discusses the technologies behind Web Browser Applications as well as how one might migrate their existing sites.
Comparing WPF applications and XBAP – What’s the difference here is good link
here is code to create thumbnail of image …. i found some where… useful for asp.net
protected void Button1_Click(object sender, EventArgs e)
{
// Get the source image to a System.Drawing.Image object
String src=@”c:\test.jpg”; //absolute location of source image
String dest=@”c:\test_th.jpg”; //absolute location of the new image created(thumbnail)
int thumbWidth=40; //width of the image (thumbnail) to produce
System.Drawing.Image image = System.Drawing.Image.FromFile(src);
// Create a System.Drawing.Bitmap with the desired width and height of the thumbnail.
int srcWidth=image.Width;
int srcHeight=image.Height;
// we will get the sizeratio in decimal so that we dont get exception in
// case width is less then height.
Decimal sizeRatio = ((Decimal)srcHeight/srcWidth);
int thumbHeight=Decimal.ToInt32(sizeRatio*thumbWidth);
Bitmap bmp = new Bitmap(thumbWidth, thumbHeight);
//- Create a System.Drawing.Graphics object from the Bitmap which we will use to draw the high quality scaled image
System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bmp);
//- Set the System.Drawing.Graphics object property SmoothingMode to HighQuality
gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//- Set the System.Drawing.Graphics object property CompositingQuality to HighQuality
gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
//- Set the System.Drawing.Graphics object property InterpolationMode to High
gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
//- Draw the original image into the target Graphics object scaling to the desired width and height
System.Drawing.Rectangle rectDestination = new System.Drawing.Rectangle(0, 0, thumbWidth, thumbHeight);
gr.DrawImage(image, rectDestination, 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel);
//- Save to destination file
bmp.Save(dest);
//- dispose / release resources
bmp.Dispose();
image.Dispose();
}
Welcome to http://samols.wordpress.com/
this is just blog… don’t mind it…