Condividi tramite


Metodo Renderer.InkSpaceToPixel (Graphics, array<Point[]%)

Aggiornamento: novembre 2007

Converte una matrice di posizioni espresse in coordinate dello spazio di input penna in coordinate dello spazio dei pixel utilizzando un oggetto Graphics per la conversione.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public Sub InkSpaceToPixel ( _
    g As Graphics, _
    ByRef pts As Point() _
)
'Utilizzo
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[]
)

Parametri

Note

Il metodo InkSpaceToPixel applica la trasformazione dell'oggetto di Renderer, applica quindi la trasformazione della visualizzazione ed esegue infine la conversione da unità HIMETRIC in pixel.

Esempi

In questo esempio, un oggetto InkOverlay viene passato a un metodo. Il metodo restituisce il riquadro dell'oggetto Ink associato nello spazio dei pixel.

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));
}

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

Renderer Classe

Membri Renderer

Overload InkSpaceToPixel

Spazio dei nomi Microsoft.Ink

Renderer.PixelToInkSpace