i assume the top is drawn the same as the bottom. However, you only notice
the jaggedness on one of the sides? Why is this so?

On 15 February 2010 02:47, nagesh govindu <[email protected]> wrote:

>    can anybody send wcf hosting methods pictorially. I searched many blogs
> for wcf . But nobody wrote clearly.So please send
>
> On Mon, Feb 15, 2010 at 11:09 AM, Raghupathi Kamuni <[email protected]
> > wrote:
>
>> You have already set SmoothingMode to AntiAlias !!
>>
>> Also set PixelOffsetMode to HighQuality
>> g.PixelOffsetMode = PixelOffsetMode.HighQuality;
>>
>> Check these links, see if you are missing anything
>> http://msdn.microsoft.com/en-us/library/9t6sa8s9.aspx
>> http://www.geekpedia.com/tutorial52_Antialiasing-or-Smoothing.html
>>
>> VB6 code on antialiasing
>>
>> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=38582&lngWId=1
>>  On Sat, Feb 13, 2010 at 1:28 PM, [email protected] <
>> [email protected]> wrote:
>>
>>> Thanks for reply
>>>
>>> code as per below
>>>
>>>
>>> using System;
>>> using System.Data;
>>> using System.Configuration;
>>> using System.Collections;
>>> using System.Web;
>>> using System.Web.Security;
>>> using System.Web.UI;
>>> using System.Web.UI.WebControls;
>>> using System.Web.UI.WebControls.WebParts;
>>> using System.Web.UI.HtmlControls;
>>> using System.IO;
>>> using System.Drawing;
>>> using System.Drawing.Imaging;
>>> using System.Drawing.Text;
>>> using System.Drawing.Drawing2D;
>>>
>>> public partial class rotateimage : System.Web.UI.Page
>>> {
>>>    protected void Page_Load(object sender, EventArgs e)
>>>    {
>>>        String imagepath = pathstr() + "Images\\sellimage.jpg";
>>>        Bitmap bmp_conv_dpi = new Bitmap(imagepath);
>>>        System.Drawing.Image i =
>>> Rotateimage((System.Drawing.Image)bmp_conv_dpi,double.Parse(
>>> queryStringValue(Request,"angle",
>>> 0)));
>>>        MemoryStream ms = new MemoryStream();
>>>        i.Save(ms, ImageFormat.Png);
>>>        Response.ContentType = "image/PNG";
>>>        ms.WriteTo(Response.OutputStream);
>>>        Response.End();
>>>    }
>>>    public string pathstr()
>>>    {
>>>        return System.AppDomain.CurrentDomain.BaseDirectory;
>>>    }
>>>    public static System.Drawing.Image
>>> Rotateimage(System.Drawing.Image image, double angle)
>>>    {
>>>
>>>        if (image == null)
>>>        {
>>>            throw new ArgumentNullException("image");
>>>        }
>>>        float oldWidth = (float)image.Width;
>>>        float oldHeight = (float)image.Height;
>>>
>>>        // Ensure angle is [0, 360)
>>>        angle = angle % 360f;
>>>        if (angle < 0.0)
>>>        {
>>>            angle += 360f;
>>>        }
>>>
>>>        PointF[] corners = new PointF[4];
>>>        // corners, clockwise from upper left
>>>        // corners[0] is origin
>>>        corners[1].X = oldWidth;
>>>        corners[2].X = oldWidth;
>>>        corners[2].Y = oldHeight;
>>>        corners[3].Y = oldHeight;
>>>
>>>        // rotate about origin
>>>        Matrix m = new Matrix();
>>>        m.Rotate((float)angle);
>>>        m.TransformPoints(corners);
>>>
>>>        // compute bounds of transformed corners from largest and
>>> smallest x and y values
>>>        double maxX = Double.MinValue;
>>>        double maxY = Double.MinValue;
>>>        double minX = Double.MaxValue;
>>>        double minY = Double.MaxValue;
>>>        foreach (PointF p in corners)
>>>        {
>>>            maxX = Math.Max(maxX, p.X);
>>>            minX = Math.Min(minX, p.X);
>>>            maxY = Math.Max(maxY, p.Y);
>>>            minY = Math.Min(minY, p.Y);
>>>        }
>>>        double newWidth = Math.Ceiling(maxX - minX);
>>>        double newHeight = Math.Ceiling(maxY - minY);
>>>
>>>        Bitmap rotatedBmp = new Bitmap((int)newWidth, (int)newHeight);
>>>        using (Graphics g = Graphics.FromImage(rotatedBmp))
>>>        {
>>>            // center of new image
>>>            PointF center = new PointF((float)(newWidth / 2), (float)
>>> (newHeight / 2));
>>>            g.SmoothingMode =
>>> System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
>>>            // position to draw old image to center it in new one
>>>            PointF position = new PointF(center.X - oldWidth / 2,
>>> center.Y - oldHeight / 2);
>>>
>>>            // rotate about center and draw
>>>            m.Reset();
>>>            m.RotateAt((float)angle, center);
>>>            g.Transform = m;
>>>            g.DrawImage(image, position);
>>>            m.Reset();
>>>
>>>
>>>            g.InterpolationMode =
>>> System.Drawing.Drawing2D.InterpolationMode.Bicubic;
>>>        }
>>>
>>>
>>>
>>>
>>>        return rotatedBmp;
>>>    }
>>>    public static string queryStringValue(HttpRequest wr, string key,
>>> object defaultValue)
>>>    {
>>>        try
>>>        {
>>>            return wr.QueryString[key].ToString();
>>>        }
>>>        catch (Exception)
>>>        { }
>>>        return defaultValue.ToString();
>>>    }
>>> }
>>>
>>>
>>> On Feb 11, 12:04 pm, Raghupathi Kamuni <[email protected]> wrote:
>>> > Show the relevant code !
>>> >
>>> > On Thu, Feb 11, 2010 at 12:20 PM, [email protected]
>>> > <[email protected]>wrote:
>>>  >
>>> > > not it is not spam , it's urgent to solve
>>> >
>>> > > On Feb 10, 5:49 pm, Processor Devil <[email protected]>
>>> wrote:
>>> > > > spam?
>>> >
>>> > > > 2010/2/10 [email protected] <[email protected]>
>>> >
>>> > > > > please check url below and find how the image distorts at edges
>>> on
>>> > > > > giving rotation angles like 5,10,50 etc. however the edges are
>>> smooth
>>> > > > > and crisp on 45 degree
>>> >
>>> > > > >http://cybersurf.in/rotationtesting.aspx
>>> >
>>> > > > > please provide solution ASAP.
>>>
>>
>>
>


-- 
Charles A. Lopez
[email protected]

Registered Microsoft Partner

New York City, NY

I'm running on Windows 7 Build 7100

Quality Software Works

Reply via email to