| C#
int yeniW = Convert.ToInt32(Request["W"].ToString());
int yeniH = Convert.ToInt32(Request["H"].ToString());
Response.ContentType="image/gif";
string URI = "http://www.google.com/images/logo.gif";
System.Drawing.Bitmap DestImage = new System.Drawing.Bitmap(276, 110, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
System.Drawing.Graphics.FromImage(DestImage).DrawImage(System.Drawing.image.FromStream(new System.Net.WebClient().OpenRead(URI)), new System.Drawing.Rectangle(0,0,276,110), new System.Drawing.Rectangle(0,0,276,110),System.Drawing.GraphicsUnit.Pixel);
System.Drawing.Bitmap imgOutput = new System.Drawing.Bitmap(DestImage, yeniW, yeniH);
imgOutput.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
imgOutput.Dispose();
VB
Dim yeniW As Integer = Convert.ToInt32(Request("W").ToString())
Dim yeniH As Integer = Convert.ToInt32(Request("H").ToString())
Response.ContentType = "image/gif"
Dim URI As String = "http://www.google.com/images/logo.gif"
Dim DestImage As New System.Drawing.Bitmap(276, 110, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
System.Drawing.Graphics.FromImage(DestImage).DrawImage(System.Drawing.image.FromStream(New System.Net.WebClient().OpenRead(URI)), New System.Drawing.Rectangle(0, 0, 276, 110), New System.Drawing.Rectangle(0, 0, 276, 110), System.Drawing.GraphicsUnit.Pixel)
Dim imgOutput As New System.Drawing.Bitmap(DestImage, yeniW, yeniH)
imgOutput.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
imgOutput.Dispose()
|