C# Класс SIL.FieldWorks.SharpViews.PaintTransform

A PaintTransform is used when actually painting boxes, or performing similar opertions like hit testing that depend on actual drawing coordinates. The first four constructor arguments are the same as for the base class, and should be the same as the most recent layout operation performed on the box to which the transform is passed. See LayoutTransform for doc. The next four arguments give the resolution at which drawing is actually done, and, in paint pixels, another offset. Typically this offset represents the amount by which the view is scrolled. Conceptually they are the distance that the top left of the view is above and left of the top left of the area in which it is drawn. This means that, after a position relative to the top left of the view is computed as the place to draw something, to convert to paint coordinates we multiply by the ratio of dpiXPaint/dpiXLayout, then subtract dxScroll...and similarly for Y.
Наследование: LayoutTransform
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ConvertToPaint Point
ConvertToPaint Rect
FromSourceAndDest PaintTransform
ToPaint Rect

Открытые методы

Метод Описание
PaintTransform ( int dxLayout, int dyLayout, int dpiXLayout, int dpiYLayout, int dxScroll, int dyScroll, int dpiXPaint, int dpiYPaint ) : System
PaintTransformOffsetBy ( int dx, int dy ) : PaintTransform

Answer a layout transform (actually a PaintTransform) suitable for a child box whose left and top are dx and dy.

ToLayout ( Point paintPoint ) : Point

Convert a point in paint coordinates to one relative to the box that uses this transformation.

ToLayoutX ( int x ) : int

Convert an X coordinate from paint to layout coords.

ToPaint ( Point layout ) : Point

Convert a complete point to Painting coordinates (not yet tested)

ToPaint ( Rectangle rLayout ) : Rectangle

Convert a rectangle relative to the box for which this transform is configured to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.

ToPaintX ( int xs ) : int

Convert a position relative to the box for which this is the transform to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.

ToPaintY ( int ys ) : int

Convert a position relative to the box for which this is the transform to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.

Приватные методы

Метод Описание
ConvertToPaint ( Point source, Rect srcRect, Rect dstRect ) : Point

Currently not used: given a point in destination coordinates and two rectangles such as are returned by SourceRect and DestRect, generate the point (ToPaintX(source.X), ToPaintY(source.Y)) that would be returned by a transformation represented by that transformation. (not yet used or tested)

ConvertToPaint ( Rect source, Rect srcRect, Rect dstRect ) : Rect

Currently only used in testing: given a point in destination coordinates and two rectangles such as are returned by SourceRect and DestRect, generate the point (ToPaintX(source.X), ToPaintY(source.Y)) that would be returned by a transformation represented by that transformation. (not yet used or tested)

FromSourceAndDest ( Rect srcRect, Rect dstRect ) : PaintTransform

Return the PaintTransform that would produce the indicated Source and Dest Rects.

ToPaint ( Rect rLayout ) : Rect

Convert a rect relative to the box for which this transform is configured to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset. Currently only used in making test data.

Описание методов

PaintTransform() публичный метод

public PaintTransform ( int dxLayout, int dyLayout, int dpiXLayout, int dpiYLayout, int dxScroll, int dyScroll, int dpiXPaint, int dpiYPaint ) : System
dxLayout int
dyLayout int
dpiXLayout int
dpiYLayout int
dxScroll int
dyScroll int
dpiXPaint int
dpiYPaint int
Результат System

PaintTransformOffsetBy() публичный метод

Answer a layout transform (actually a PaintTransform) suitable for a child box whose left and top are dx and dy.
public PaintTransformOffsetBy ( int dx, int dy ) : PaintTransform
dx int
dy int
Результат PaintTransform

ToLayout() публичный метод

Convert a point in paint coordinates to one relative to the box that uses this transformation.
public ToLayout ( Point paintPoint ) : Point
paintPoint Point
Результат Point

ToLayoutX() публичный метод

Convert an X coordinate from paint to layout coords.
public ToLayoutX ( int x ) : int
x int
Результат int

ToPaint() публичный метод

Convert a complete point to Painting coordinates (not yet tested)
public ToPaint ( Point layout ) : Point
layout Point
Результат Point

ToPaint() публичный метод

Convert a rectangle relative to the box for which this transform is configured to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.
public ToPaint ( Rectangle rLayout ) : Rectangle
rLayout System.Drawing.Rectangle
Результат System.Drawing.Rectangle

ToPaintX() публичный метод

Convert a position relative to the box for which this is the transform to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.
public ToPaintX ( int xs ) : int
xs int
Результат int

ToPaintY() публичный метод

Convert a position relative to the box for which this is the transform to one in paint coordinates. Todo: tests and implementation of differing DPI and non-zero ScrollOffset.
public ToPaintY ( int ys ) : int
ys int
Результат int