Поделиться через


Renderer.InkSpaceToPixel - метод (Graphics, array<Point[]%)

Обновлен: Ноябрь 2007

Converts an array of locations in ink space coordinates to be in pixel space by using a Graphics object for the conversion.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Sub InkSpaceToPixel ( _
    g As Graphics, _
    ByRef pts As Point() _
)
'Применение
Dim instance As Renderer
Dim g As Graphics
Dim pts As Point()

instance.InkSpaceToPixel(g, pts)
public void InkSpaceToPixel(
    Graphics g,
    ref Point[] pts
)
public:
void InkSpaceToPixel(
    Graphics^ g, 
    array<Point>^% pts
)
public void InkSpaceToPixel(
    Graphics g,
    /** @ref */Point[] pts
)
public function InkSpaceToPixel(
    g : Graphics, 
    pts : Point[]
)

Параметры

Заметки

The InkSpaceToPixel method applies the object transform of the Renderer object, applies the view transform, and then converts from HIMETRIC to pixel units.

Примеры

In this example, an InkOverlay object is passed to a method. The method returns the the bounding box of the associated Ink object in pixel space.

Public Function GetInkBoundsInPixels(ByVal theInkOverlay As InkOverlay) As Rectangle
    ' Copy the bounding rectangle in ink space dimensions
    Dim theBoundingRectangle As Rectangle = theInkOverlay.Ink.GetBoundingBox()
    ' Get the top left and bottom right points
    Dim corners() As Point = _
            { _
              theBoundingRectangle.Location, _
              theBoundingRectangle.Location + theBoundingRectangle.Size _
            }
    Using g As Graphics = mInkOverlay.AttachedControl.CreateGraphics()
        ' Convert from ink space to pixel space
        theInkOverlay.Renderer.InkSpaceToPixel(g, corners)
    End Using
    Return New Rectangle(corners(0), _
        New Size(corners(1).X - corners(0).X, corners(1).Y - corners(0).Y))
End Function
public Rectangle GetInkBoundsInPixels(InkOverlay theInkOverlay)
{
    // Copy the bounding rectangle in ink space dimensions
    Rectangle theBoundingRectangle = theInkOverlay.Ink.GetBoundingBox();
    // Get the top left and bottom right points
    Point[] corners = new Point[2] 
        {
            theBoundingRectangle.Location,
            theBoundingRectangle.Location + theBoundingRectangle.Size
        };
    using (Graphics g = mInkOverlay.AttachedControl.CreateGraphics())
    {
        // Convert from ink space to pixel space
        theInkOverlay.Renderer.InkSpaceToPixel(g, ref corners);
    }
    return new Rectangle(corners[0],
        new Size(corners[1].X - corners[0].X, corners[1].Y - corners[0].Y));
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Renderer Класс

Renderer - члены

InkSpaceToPixel - перегрузка

Microsoft.Ink - пространство имен

Renderer.PixelToInkSpace