Pixel() public method

Returns a screen pixel from an absolute location. NOTE: We don't return a 'Point' because it is different in Forms/Silverlight.
public Pixel ( Vector3D point ) : Vector3D
point Vector3D
return Vector3D
コード例 #1
0
ファイル: GraphicsUtils.cs プロジェクト: roice3/Honeycombs
        private static Rectangle? Rect( Circle c, ImageSpace i )
        {
            if( double.IsInfinity( c.Radius ) )
                return null;

            Vector3D upperLeft = i.Pixel( new Vector3D( c.Center.X - c.Radius, c.Center.Y + c.Radius, 0 ) );
            double width = i.Width( c.Radius * 2 );
            double height = i.Height( c.Radius * 2 );
            Rectangle rect = new Rectangle( (int)upperLeft.X, (int)upperLeft.Y, (int)width, (int)height );
            return rect;
        }
コード例 #2
0
        static private Rectangle?Rect(Circle c, ImageSpace i)
        {
            if (double.IsInfinity(c.Radius))
            {
                return(null);
            }

            Vector3D  upperLeft = i.Pixel(new Vector3D(c.Center.X - c.Radius, c.Center.Y + c.Radius, 0));
            double    width     = i.Width(c.Radius * 2);
            double    height    = i.Height(c.Radius * 2);
            Rectangle rect      = new Rectangle((int)upperLeft.X, (int)upperLeft.Y, (int)width, (int)height);

            return(rect);
        }
コード例 #3
0
        static public void DrawCircle(Circle c, Graphics g, ImageSpace i)
        {
            if (double.IsInfinity(c.Radius))
            {
                return;
            }

            Vector3D  upperLeft = i.Pixel(new Vector3D(c.Center.X - c.Radius, c.Center.Y + c.Radius, 0));
            double    width     = i.Width(c.Radius * 2);
            double    height    = i.Height(c.Radius * 2);
            Rectangle rect      = new Rectangle((int)upperLeft.X, (int)upperLeft.Y, (int)width, (int)height);

            using (Pen pen = new Pen(Color.Black, 1.0f))
                g.DrawEllipse(pen, rect);
        }
コード例 #4
0
        static private Point VecToPoint(Vector3D vec, ImageSpace i)
        {
            Vector3D temp = i.Pixel(vec);

            return(new Point((int)temp.X, (int)temp.Y));
        }
コード例 #5
0
ファイル: GraphicsUtils.cs プロジェクト: roice3/Honeycombs
 private static Point VecToPoint( Vector3D vec, ImageSpace i )
 {
     Vector3D temp = i.Pixel( vec );
     return new Point( (int)temp.X, (int)temp.Y );
 }