This canvas displays an image in the background and arranges its children according to the pixel coordinates of the image. More...
Inherits Panel, IDisplay, and IScrollInfo.
Public Member Functions | |
bool | GetIsAnimated (Visual visual) |
Gets the animated status of the ZoomCenter and ZoomFactor changes. More... | |
void | SetIsAnimated (Visual visual, bool isAnimated) |
Sets the animated status of the ZoomCenter and ZoomFactor changes. More... | |
DisplayCanvas () | |
Creates an empty display canvas. | |
Point | TranslatePointToImage (Point point) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels. More... | |
Point | TranslatePointToImage (Point point, PixelCoordinateSystem correction) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels. More... | |
Point | TranslatePointToImage (Point point, CoordinateSystemType coordinateType) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels. More... | |
Point | TranslatePointFromImage (Point point) |
Translates a point relative to the ImageSource content pixels to coordinates relative to this panel. More... | |
Point | TranslatePointFromImage (Point point, CoordinateSystemType coordinateType) |
Translates a point relative to the ImageSource content pixels to coordinates relative to this panel. More... | |
WinRect | TranslateRectToImage (WinRect rect) |
Translates a rect relative to this panel to coordinates that are relative to the ImageSource content pixels. More... | |
WinRect | TranslateRectToImage (WinRect rect, CoordinateSystemType coordinateType) |
Translates a rect relative to this panel to coordinates that are relative to the ImageSource content pixels. More... | |
WinRect | TranslateRectFromImage (WinRect rect) |
Translates a rect relative to the ImageSource content pixels to coordinates relative to this panel. More... | |
WinRect | TranslateRectFromImage (WinRect rect, CoordinateSystemType coordinateType) |
Translates a rect relative to the ImageSource content pixels to coordinates relative to this panel. More... | |
Size | TranslateSizeToImage (Size size) |
Translates a size relative to this panel to a size relative to the ImageSource content pixels. More... | |
Size | TranslateSizeFromImage (Size size) |
Translates a size relative to the ImageSource content pixels to a size relative to this panel. More... | |
void | RedrawImage () |
Redraws the display based on the set IDisplay.Image. More... | |
Task | RedrawImageAsync () |
Redraws the display based on the set IDisplay.Image when the display is rendered the next time. More... | |
Task | SetImageAsync (Image image) |
Sets a new image asynchronously. More... | |
void | LineDown () |
Scrolls down within content by one logical unit (image pixel). More... | |
void | LineLeft () |
Scrolls left within content by one logical unit (image pixel). More... | |
void | LineRight () |
Scrolls right within content by one logical unit (image pixel). More... | |
void | LineUp () |
Scrolls up within content by one logical unit (image pixel). More... | |
WinRect | MakeVisible (Visual visual, WinRect rectangle) |
Forces content to scroll until the coordinate space of a Visual object is visible. More... | |
void | MouseWheelDown () |
Scrolls a line down. | |
void | MouseWheelLeft () |
Same es DisplayCanvas.LineLeft. | |
void | MouseWheelRight () |
Same es DisplayCanvas.LineRight. | |
void | MouseWheelUp () |
Scrolls a line up. | |
void | PageDown () |
Scrolls down within content by one page (view port). More... | |
void | PageLeft () |
Scrolls left within content by one page (view port). More... | |
void | PageRight () |
Scrolls right within content by one page (view port). More... | |
void | PageUp () |
Scrolls up within content by one page (view port). More... | |
void | SetHorizontalOffset (double offset) |
Sets the amount of horizontal offset. More... | |
void | SetVerticalOffset (double offset) |
Sets the amount of vertical offset. More... | |
void | SetOffset (double offsetX, double offsetY) |
Sets the amount of horizontal and vertical offset. More... | |
void | RedrawImage () |
Redraws the display based on the set IDisplay.Image. More... | |
Static Public Member Functions | |
static double | GetBottom (Visual visual) |
Gets the value of the attached BottomProperty for the given visual . More... | |
static void | SetBottom (Visual visual, double length) |
Sets the value of the attached BottomProperty for the given visual . More... | |
static HighBitScaleMode | GetHighBitScaleMode (Visual visual) |
Gets the Stemmer.Cvb.HighBitScaleMode from the given visual . More... | |
static void | SetHighBitScaleMode (Visual visual, HighBitScaleMode scaleMode) |
Sets the scaleMode to the given visual . More... | |
static AutoScaleContent | GetAutoScaleContent (Visual visual) |
Gets the value of the AutoScaleContentProperty from the given visual . More... | |
static void | SetAutoScaleContent (Visual visual, AutoScaleContent autoScale) |
Sets the autoScale value to the given visual . More... | |
static double | GetLeft (Visual visual) |
Gets the value of the attached LeftProperty from the given visual . More... | |
static void | SetLeft (Visual visual, double length) |
Sets the value of the attached LeftProperty for the given visual . More... | |
static LengthUnit | GetLengthUnit (Visual visual) |
Gets the attached LengthUnitProperty for the given visual . More... | |
static void | SetLengthUnit (Visual visual, LengthUnit unit) |
Sets the attached LengthUnitProperty for the given visual . More... | |
static int | GetMaxDecodePixelHeight (Visual visual) |
Gets the attached MaxDecodePixelHeightProperty for the given visual . More... | |
static void | SetMaxDecodePixelHeight (Visual visual, int value) |
Sets the attached MaxDecodePixelHeightProperty for the given visual . More... | |
static int | GetMaxDecodePixelWidth (Visual visual) |
Gets the attached MaxDecodePixelWidthProperty for the given visual . More... | |
static void | SetMaxDecodePixelWidth (Visual visual, int value) |
Sets the attached MaxDecodePixelWidthProperty for the given visual . More... | |
static PixelCoordinateSystem | GetPixelCoordinateSystem (Visual visual) |
Gets the attached PixelCoordinateSystemProperty for the given visual . More... | |
static void | SetPixelCoordinateSystem (Visual visual, PixelCoordinateSystem coordinateSystem) |
Sets the attached PixelCoordinateSystemProperty to the given visual . More... | |
static double | GetRight (Visual visual) |
Gets the value of the attached RightProperty for the given visual . More... | |
static void | SetRight (Visual visual, double length) |
Sets the value of the attached RightProperty for the given visual . More... | |
static double | GetTop (Visual visual) |
Gets the value of the attached TopProperty for the given visual . More... | |
static void | SetTop (Visual visual, double length) |
Sets the value of the attached TopProperty for the given visual . More... | |
static Point | GetZoomCenter (DependencyObject d) |
Gets the attached zoom center property from the given dependency object d . More... | |
static void | SetZoomCenter (DependencyObject d, Point center) |
Sets the attached zoom center property on the given dependency object d . More... | |
static double | GetZoomFactor (DependencyObject d) |
Gets the zoom factor from the given dependency object d . More... | |
static void | SetZoomFactor (DependencyObject d, double factor) |
Sets the zoom factor to the given dependency object d . More... | |
Static Public Attributes | |
static readonly RoutedEvent | ActualZoomCenterChangedEvent |
Backing store for ActualZoomCenterChanged. | |
static readonly RoutedEvent | ActualZoomFactorChangedEvent |
Backing store for ActualZoomFactorChanged. | |
static readonly RoutedEvent | ImageDataUpdatedEvent |
Backing store for the ImageDataUpdated event. | |
static readonly RoutedEvent | ImageSourceChangedEvent |
Backing store for the ImageSourceChanged event. | |
static readonly RoutedEvent | ZoomCenterChangedEvent |
Backing store for ZoomCenterChanged. | |
static readonly RoutedEvent | ZoomFactorChangedEvent |
Backing store for ZoomFactorChanged. | |
static readonly DependencyProperty | ActualZoomCenterProperty |
Backing store for read-only ActualZoomCenter. | |
static readonly DependencyProperty | ActualZoomFactorProperty |
Backing store for read-only ActualZoomFactor. | |
static readonly DependencyProperty | AnimationDurationProperty |
Backing store for AnimationDuration. | |
static readonly DependencyProperty | ImageProperty |
Backing store for Image. | |
static readonly DependencyProperty | DisplayBitmapSizeLimitProperty |
DisplayBitmapSizeLimit dependency property. | |
static readonly DependencyProperty | ImageObserverProperty |
Backing store for the read only ImageObserver dependency property. | |
static readonly DependencyProperty | FrameTimeMinProperty |
Backing store of the FrameTimeMin property. | |
static readonly DependencyProperty | ImageSourceProperty |
Backing store for ImageSource. | |
static readonly DependencyProperty | ImageViewportHeightProperty |
Backing store of the ImageViewportHeight property. | |
static readonly DependencyProperty | ImageViewportHorizontalOffsetProperty |
Backing store of the ImageViewportHorizontalOffset property. | |
static readonly DependencyProperty | ImageViewportVerticalOffsetProperty |
Backing store of the ImageViewportVerticalOffset property. | |
static readonly DependencyProperty | ImageViewportWidthProperty |
Backing store of the ImageViewportWidth property. | |
static readonly DependencyProperty | IsAnimationInProgressProperty |
Backing store for the read only IsAnimationInProgress property. | |
static readonly DependencyProperty | IsInStretchModeProperty |
Backing store for read only IsInStretchMode. | |
static readonly DependencyProperty | IsZoomActiveProperty |
Backing store for the IsZoomActive. | |
static readonly DependencyProperty | PixelRasterMinExtentProperty |
Backing store for the PixelRasterMinExtent property. | |
static readonly DependencyProperty | PixelRasterVisibleProperty |
Backing store the PixelRasterVisible property. | |
static readonly DependencyProperty | RedrawOnImageDataUpdatedProperty |
Backing store of the RedrawOnImageDataUpdated property. | |
static readonly DependencyProperty | StretchZoomFactorProperty |
Backing store for read only StretchZoomFactor. | |
static readonly DependencyProperty | ZoomTransformProperty |
Backing store for ZoomTransform. | |
static readonly DependencyProperty | BottomProperty |
Backing store for the Bottom attached property. More... | |
static readonly DependencyProperty | HighBitScaleModeProperty |
Backing store for the DisplayCanvas.HighBitScaleMode attached property. | |
static DependencyProperty | IsAnimatedProperty |
Backing store for the IsAnimated attached property. More... | |
static readonly DependencyProperty | AutoScaleContentProperty |
Defines whether or not the overlays in the canvas are automatically scaled according to the zoom factor. More... | |
static readonly DependencyProperty | LeftProperty |
Backing store for the Left attached property. More... | |
static readonly DependencyProperty | LengthUnitProperty |
Backing store for the LengthUnit attached property. More... | |
static readonly DependencyProperty | MaxDecodePixelHeightProperty |
Backing store for the MaxDecodePixelHeightProperty attached property. More... | |
static readonly DependencyProperty | MaxDecodePixelWidthProperty |
Backing store for the MaxDecodePixelWidthProperty attached property. More... | |
static readonly DependencyProperty | PixelCoordinateSystemProperty |
Backing store for the PixelCoordinateSystem attached property. More... | |
static readonly DependencyProperty | RightProperty |
Backing store for the Right attached property. More... | |
static readonly DependencyProperty | TopProperty |
Backing store for the Top attached property. More... | |
static readonly DependencyProperty | ZoomCenterProperty |
Backing store for the ZoomCenter attached property. | |
static readonly DependencyProperty | ZoomFactorProperty |
Backing store for the ZoomFactor attached property. | |
Protected Member Functions | |
override Size | ArrangeOverride (Size arrangeBounds) |
Called to arrange and size the content of an object. More... | |
override Size | MeasureOverride (Size availableSize) |
Measures the size in layout required for child elements and determines a size for this control. More... | |
override void | OnVisualChildrenChanged (DependencyObject visualAdded, DependencyObject visualRemoved) |
Called when children are added/removed. More... | |
override void | OnRender (DrawingContext dc) |
Renders the zoomed image to the background. More... | |
Properties | |
EventHandler< DisplayZoomEventArgs > | ActualZoomCenterChanged |
Bubbling routed event that is fired when the ActualZoomCenter changes. | |
EventHandler< DisplayZoomEventArgs > | ActualZoomFactorChanged |
Bubbling routed event that is fired when the ActualZoomFactor changes. | |
EventHandler< RoutedEventArgs > | ImageDataUpdated |
Bubbling event that is fired when the display's image data is updated. | |
EventHandler< ImageSourceChangedEventArgs > | ImageSourceChanged |
Bubbling event that is fired when the ImageSource changes. | |
EventHandler< DisplayZoomEventArgs > | ZoomCenterChanged |
Bubbling event that is fired when the ZoomCenter property is changed. | |
EventHandler< DisplayZoomEventArgs > | ZoomFactorChanged |
Bubbling event that is fired when the ZoomFactor property is changed. | |
Point | ActualZoomCenter [get] |
Gets the rendered zoom center of this display. More... | |
double | ActualZoomFactor [get] |
Gets the rendered zoom factor of this display. More... | |
Duration | AnimationDuration [get, set] |
Duration for panning and zoom animations. | |
Image | Image [get, set] |
Gets/sets a Stemmer.Cvb.Image as the image source of this display. More... | |
long | DisplayBitmapSizeLimit [get, set] |
Out Display is capable of transferring responsibility for zoom handling to the GPU by committing the CVB image data to a WriteableBitmap object. However, WriteableBitmaps are afflicted by a bug in the WPF runtime that seems to be triggered depending on the bitmap's size (see for example this discussion here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/d4f943eb-630e-48ac-a8f8-00e539bb7856/wpf-crashes-with-error-hresult-0x88980406-at?forum=wpf We are currently working around this issue by limiting the size of the WriteableBitmap that is generated (if a Cvb image that is too big is set on the Image property an OutOfMemoryException will be raised). As the size limit cannot be determined by any means available to us, we are working with a definable limit. The default has been chosen to a size that we have found to generally work well on our systems. | |
IObserver< Image > | ImageObserver [get] |
Gets the observer to receive new Image pushes. More... | |
Duration | FrameTimeMin [get, set] |
Gets or sets the minimal frame time for displaying new frames. More... | |
System.Windows.Media.Imaging.BitmapSource | ImageSource [get, set] |
Image source of this display. More... | |
double | ImageViewportHeight [get] |
Gets the the displayed image region shown width. More... | |
double | ImageViewportHorizontalOffset [get] |
Gets the horizontal offset to the displayed image. More... | |
double | ImageViewportVerticalOffset [get] |
Gets the vertical offset to the displayed image. More... | |
double | ImageViewportWidth [get] |
Gets the the displayed image region shown width. More... | |
bool | IsAnimationInProgress [get] |
Gets whether the default animation is currently active. | |
bool | IsInStretchMode [get] |
Gets whether the stretch mode is active and not the zoom mode. More... | |
bool | IsZoomActive [get] |
Gets whether this control is currently in zoom mode despite stretch mode. More... | |
double | PixelRasterMinExtent [get, set] |
Gets/sets the minimum extent (width/height) of a pixel until the pixel raster is shown. | |
bool | PixelRasterVisible [get, set] |
Gets/sets whether a pixel raster is shown in higher zoom levels. | |
bool | RedrawOnImageDataUpdated [get, set] |
Gets/sets whether the display is to be redrawn as soon as the image data has been updated. More... | |
double | StretchZoomFactor [get] |
Gets the zoom factor as if in the case as if this control would be in stretch mode. More... | |
Transform | ZoomTransform [get] |
The transform affecting the zoom parameters. More... | |
HighBitScaleMode | HighBitScaleMode [get, set] |
Gets/sets the Stemmer.Cvb.HighBitScaleMode used by this display canvas. | |
bool | IsAnimated [get, set] |
Gets/sets whether interactive zoom center/factor changes are animated. | |
Point | ZoomCenter [get, set] |
Gets/sets the zoom center. More... | |
double | ZoomFactor [get, set] |
The current zoom factor of the image. More... | |
Size | PixelSize [get] |
Gets the size of one ImageSource pixel. More... | |
bool | CanHorizontallyScroll [get, set] |
Gets or sets a value that indicates whether scrolling on the horizontal axis is possible. | |
bool | CanVerticallyScroll [get, set] |
Gets or sets a value that indicates whether scrolling on the vertical axis is possible. | |
double | ExtentHeight [get] |
Gets the vertical size of the image, including the content that is not visible, in device independent pixels. More... | |
double | ExtentWidth [get] |
Gets the horizontal size of the image, including the content that is not visible, in device independent pixels. More... | |
double | HorizontalOffset [get] |
Gets the horizontal offset of the scrolled content. More... | |
ScrollViewer | ScrollOwner [get, set] |
Gets or sets a System.Windows.Controls.ScrollViewer element that controls scrolling behavior. | |
double | VerticalOffset [get] |
Gets the vertical offset of the scrolled content. More... | |
double | ViewportHeight [get] |
Gets the vertical size of the view port for this content. More... | |
double | ViewportWidth [get] |
Gets the horizontal size of the view port for this content. More... | |
![]() | |
Point | ActualZoomCenter [get] |
Gets the rendered zoom center of this display. More... | |
double | ActualZoomFactor [get] |
Gets the rendered zoom factor of this display. More... | |
Image | Image [get, set] |
Gets/sets a Stemmer.Cvb.Image as the image source of this display. More... | |
HighBitScaleMode | HighBitScaleMode [get, set] |
Gets/sets the Stemmer.Cvb.HighBitScaleMode used by this display. | |
BitmapSource | ImageSource [get, set] |
Image source of this display. More... | |
bool | IsAnimated [get, set] |
Gets/sets whether ZoomCenter or ZoomFactor changes are animated. | |
bool | IsAnimationInProgress [get] |
Gets whether the control's internal animation is in progress. | |
bool | IsInStretchMode [get] |
Gets whether the stretch mode is active and not the zoom mode. More... | |
bool | IsZoomActive [get] |
Gets whether this control is currently in zoom mode and the zoom factor is greater than one. More... | |
double | StretchZoomFactor [get] |
Gets the zoom factor as if in the case as if this control would be in stretch mode. More... | |
Point | ZoomCenter [get, set] |
Gets/sets the zoom center. More... | |
double | ZoomFactor [get, set] |
The current zoom factor of the image. More... | |
Additional Inherited Members | |
![]() | |
EventHandler< DisplayZoomEventArgs > | ActualZoomCenterChanged |
Bubbling routed event that is fired when the ActualZoomCenter changes. | |
EventHandler< DisplayZoomEventArgs > | ActualZoomFactorChanged |
Bubbling routed event that is fired when the ActualZoomFactor changes. | |
EventHandler< DisplayZoomEventArgs > | ZoomCenterChanged |
Bubbling event that is fired when the ZoomCenter property is changed. | |
EventHandler< DisplayZoomEventArgs > | ZoomFactorChanged |
Bubbling event that is fired when the ZoomFactor property is changed. | |
This canvas displays an image in the background and arranges its children according to the pixel coordinates of the image.
To use the display canvas in your projects, follow these steps:
Example on how to place a standard WPF Rectangle
on the canvas:
|
protected |
Called to arrange and size the content of an object.
Used to update layout dependent properties.
arrangeBounds | The computed size that is used to arrange the content. |
|
static |
Gets the value of the AutoScaleContentProperty from the given visual .
visual | The element from which the property value is read. |
|
static |
Gets the value of the attached BottomProperty for the given visual .
visual | The element to which the property value is read. |
.
|
static |
Gets the Stemmer.Cvb.HighBitScaleMode from the given visual .
visual | The element from which the property value is read. |
bool GetIsAnimated | ( | Visual | visual | ) |
Gets the animated status of the ZoomCenter and ZoomFactor changes.
visual | The element to get the value from. |
true
if value sets are animated; false
if not.
|
static |
Gets the value of the attached LeftProperty from the given visual .
visual | The element from which the property value is read. |
.
|
static |
Gets the attached LengthUnitProperty for the given visual .
visual | The element to which the property value is read. |
|
static |
Gets the attached MaxDecodePixelHeightProperty for the given visual .
visual | The element to which the property value is read. |
|
static |
Gets the attached MaxDecodePixelWidthProperty for the given visual .
visual | The element to which the property value is read. |
|
static |
Gets the attached PixelCoordinateSystemProperty for the given visual .
visual | The element to read the property value from. |
|
static |
Gets the value of the attached RightProperty for the given visual .
visual | The element to which the property value is read. |
.
|
static |
Gets the value of the attached TopProperty for the given visual .
visual | The element to which the property value is read. |
.
|
static |
Gets the attached zoom center property from the given dependency object d .
This method makes the attached property accessible from XAML.
d | Dependency object to get attached property from. |
|
static |
Gets the zoom factor from the given dependency object d .
A zoom factor larger than 1.0 magnifies the displayed image; values smaller than 1.0 zoom out whereas 1.0 displays the image as is (this resembles System.Windows.Media.Stretch.None). The special value 0.0 identifies the panorama or stretch mode which resembles System.Windows.Media.Stretch.Uniform (the default). Values smaller 0.0 are invalid.
This method makes the attached property accessible from XAML.
d | Dependency object to get the zoom factor from. |
void LineDown | ( | ) |
Scrolls down within content by one logical unit (image pixel).
Snaps to image pixel units.
void LineLeft | ( | ) |
Scrolls left within content by one logical unit (image pixel).
Snaps to image pixel units.
void LineRight | ( | ) |
Scrolls right within content by one logical unit (image pixel).
Snaps to image pixel units.
void LineUp | ( | ) |
Scrolls up within content by one logical unit (image pixel).
Snaps to image pixel units.
WinRect MakeVisible | ( | Visual | visual, |
WinRect | rectangle | ||
) |
Forces content to scroll until the coordinate space of a Visual object is visible.
In most cases, the returned rectangle is a transformed version of the input rectangle. In some cases, such as when the input rectangle cannot fit entirely within the view port, the return value may be smaller.
visual | A Visual to become visible. |
rectangle | A bounding rectangle that identifies the coordinate space to make visible. |
|
protected |
Measures the size in layout required for child elements and determines a size for this control.
availableSize | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
|
protected |
Renders the zoomed image to the background.
dc | Drawing context of this canvas. |
|
protected |
Called when children are added/removed.
visualAdded | Added visual. |
visualRemoved | Removed visual. |
void PageDown | ( | ) |
Scrolls down within content by one page (view port).
Snaps to image pixel units.
void PageLeft | ( | ) |
Scrolls left within content by one page (view port).
Snaps to image pixel units.
void PageRight | ( | ) |
Scrolls right within content by one page (view port).
Snaps to image pixel units.
void PageUp | ( | ) |
Scrolls up within content by one page (view port).
Snaps to image pixel units.
void RedrawImage | ( | ) |
Redraws the display based on the set IDisplay.Image.
This method only works with a set Stemmer.Cvb.Image and redraws this display with the image's content. This method does nothing if only a BitmapSource is set.
Implements IDisplay.
Task RedrawImageAsync | ( | ) |
Redraws the display based on the set IDisplay.Image when the display is rendered the next time.
If multiple redraws are to be done in one render phase, only one is performed.
Attention:
Image drawing is performed in the UI thread. Thus if you Task.Wait() on the returned Task from the UI thread, the application will dead lock.
Otherwise it is safe to call this method from non-UI threads.
|
static |
Sets the autoScale value to the given visual .
visual | The element to which the property value is set. |
autoScale | Whether or not the item is scaled. |
|
static |
Sets the value of the attached BottomProperty for the given visual .
visual | The element from which the property value is written. |
length | Offset from the canvas bottom border. |
|
static |
Sets the scaleMode to the given visual .
visual | The element to which the property value is written. |
scaleMode | New scale mode. |
void SetHorizontalOffset | ( | double | offset | ) |
Sets the amount of horizontal offset.
offset | The degree to which content is horizontally offset from the containing view port in device independent pixels. |
Task SetImageAsync | ( | Image | image | ) |
Sets a new image asynchronously.
If multiple image s are to be displayed in one render phase, only the newest is rendered.
Attention:
Image drawing is performed in the UI thread. Thus if you Task.Wait() on the returned Task from the UI thread, the application will dead lock.
Otherwise it is safe to call this method from non-UI threads.
image | Image to display. |
void SetIsAnimated | ( | Visual | visual, |
bool | isAnimated | ||
) |
Sets the animated status of the ZoomCenter and ZoomFactor changes.
visual | The element to set the value on. |
isAnimated | true if value sets are animated; false for not. |
|
static |
Sets the value of the attached LeftProperty for the given visual .
visual | The element to which the property value is written. |
length | Offset from the canvas left border. |
|
static |
Sets the attached LengthUnitProperty for the given visual .
visual | The element to which the property value is written. |
unit | Unit to be used. |
|
static |
Sets the attached MaxDecodePixelHeightProperty for the given visual .
visual | The element to which the property value is written. |
value | Value to be used. |
|
static |
Sets the attached MaxDecodePixelWidthProperty for the given visual .
visual | The element to which the property value is written. |
value | Value to be used. |
void SetOffset | ( | double | offsetX, |
double | offsetY | ||
) |
Sets the amount of horizontal and vertical offset.
offsetX | The degree to which content is horizontally offset from the containing view port in device independent pixels. |
offsetY | The degree to which content is vertically offset from the containing view port in device independent pixels. |
|
static |
Sets the attached PixelCoordinateSystemProperty to the given visual .
visual | The element to which the property value is written. |
coordinateSystem | Coordinate system to use. |
|
static |
Sets the value of the attached RightProperty for the given visual .
visual | The element to which the property value is written. |
length | Offset from the canvas right border. |
|
static |
Sets the value of the attached TopProperty for the given visual .
visual | The element to which the property value is written. |
length | Offset from the canvas top border. |
void SetVerticalOffset | ( | double | offset | ) |
Sets the amount of vertical offset.
offset | The degree to which content is vertically offset from the containing view port in device independent pixels. |
|
static |
Sets the attached zoom center property on the given dependency object d .
This method makes the attached property accessible from XAML.
d | Dependency object to set attached property on. |
center | Point in the bitmap source which is the center of the zoomed view port. Coordinates are in bitmap pixels. |
|
static |
Sets the zoom factor to the given dependency object d .
A zoom factor larger than 1.0 magnifies the displayed image; values smaller than 1.0 zoom out whereas 1.0 displays the image as is (this resembles System.Windows.Media.Stretch.None). The special value 0.0 identifies the panorama or stretch mode which resembles System.Windows.Media.Stretch.Uniform (the default). Values smaller 0.0 are invalid.
This method makes the attached property accessible from XAML.
d | Dependency object to set the zoom factor to. |
factor | The new zoom factor. |
Point TranslatePointFromImage | ( | Point | point | ) |
Translates a point relative to the ImageSource content pixels to coordinates relative to this panel.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions. This method behaves as if you would call
.
point | Point relative to the image source pixels. |
Point TranslatePointFromImage | ( | Point | point, |
CoordinateSystemType | coordinateType | ||
) |
Translates a point relative to the ImageSource content pixels to coordinates relative to this panel.
Dependent on the ActualZoomFactor and the image coordinate system the translated coordinates may contain fractions.
point | Point relative to the image source pixels. |
coordinateType | Defines whether the image coordinate system is incorporated in the calculation. |
Point TranslatePointToImage | ( | Point | point | ) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions. This method behaves as if you would call
.
point | Point as relative to this panel. |
Point TranslatePointToImage | ( | Point | point, |
CoordinateSystemType | coordinateType | ||
) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels.
Dependent on the ActualZoomFactor and the image coordinate system the translated coordinates may contain fractions.
point | Point as relative to this panel. |
coordinateType | Defines whether the image coordinate system is incorporated in the calculation. |
Point TranslatePointToImage | ( | Point | point, |
PixelCoordinateSystem | correction | ||
) |
Translates a point relative to this panel to coordinates that are relative to the ImageSource content pixels.
point | Point as relative to this panel. |
correction | Coordinate type for correction. By default, a pixel coordinate is considered to be in the left top corner (parameter value LeftTop). With Barycentric correction it may be shifted to the center, which is sometimes useful. |
WinRect TranslateRectFromImage | ( | WinRect | rect | ) |
Translates a rect relative to the ImageSource content pixels to coordinates relative to this panel.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions. This method behaves as if you would call
.
rect | Rectangle relative to the image source pixels. |
WinRect TranslateRectFromImage | ( | WinRect | rect, |
CoordinateSystemType | coordinateType | ||
) |
Translates a rect relative to the ImageSource content pixels to coordinates relative to this panel.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions.
rect | Rectangle relative to the image source pixels. |
coordinateType | Defines whether the image coordinate system is incorporated in the calculation. |
WinRect TranslateRectToImage | ( | WinRect | rect | ) |
Translates a rect relative to this panel to coordinates that are relative to the ImageSource content pixels.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions. This method behaves as if you would call
.
rect | Rectangle relative to this panel. |
WinRect TranslateRectToImage | ( | WinRect | rect, |
CoordinateSystemType | coordinateType | ||
) |
Translates a rect relative to this panel to coordinates that are relative to the ImageSource content pixels.
Dependent on the ActualZoomFactor the translated coordinates may contain fractions.
rect | Rectangle relative to this panel. |
coordinateType | Defines whether the image coordinate system is incorporated in the calculation. |
Size TranslateSizeFromImage | ( | Size | size | ) |
Translates a size relative to the ImageSource content pixels to a size relative to this panel.
Dependent on the ActualZoomFactor the translated size may contain fractions.
size | Size relative to the image source pixels. |
Size TranslateSizeToImage | ( | Size | size | ) |
Translates a size relative to this panel to a size relative to the ImageSource content pixels.
Dependent on the ActualZoomFactor the translated size may contain fractions.
size | Size relative to this panel. |
|
static |
Defines whether or not the overlays in the canvas are automatically scaled according to the zoom factor.
Gets/sets whether or not the overlay in the canvas is automatically scaled according to the zoom factor.
Default is AutoScaleContent.RenderTransform.
|
static |
Backing store for the Bottom attached property.
Gets/sets the offset from the bottom border for a child element.
Default is double.NaN for not used.
|
static |
Backing store for the IsAnimated attached property.
Gets/sets whether interactive zoom center/factor changes are animated.
Default is true
.
|
static |
Backing store for the Left attached property.
Gets/sets the offset from the left border for a child element.
Default is double.NaN for not used.
|
static |
Backing store for the LengthUnit attached property.
Defines whether the layout properties are measured in image pixels (default) or in device independent pixels as displayed by the canvas.
By setting this property you can define whether the overlay should be aligned according to the underlying image (image pixels) or against the canvas (device independent pixels).
Default is LengthUnit.ImagePixel.
|
static |
Backing store for the MaxDecodePixelHeightProperty attached property.
Gets/sets maximal decode height for the ImageSource.
Decodes the ImageSource image at this maximal resolution if unequal 0. If only one of the decode properties is set, the aspect ratio is preserved.
0 is default and doesn't change the ImageSource size.
|
static |
Backing store for the MaxDecodePixelWidthProperty attached property.
Gets/sets maximal decode height for the ImageSource.
Decodes the ImageSource image at this maximal resolution if unequal 0. If only one of the decode properties is set, the aspect ratio is preserved.
0 is default and doesn't change the ImageSource size.
|
static |
Backing store for the PixelCoordinateSystem attached property.
Defines the location of a point in a pixel.
This attached works in conjunction with the LengthUnitProperty if it is set to LengthUnit.ImagePixel. It is ignored for LengthUnit.DeviceIndependentPixel.
This defines where overlays are placed in the canvas. Either at the left-top location or in the center of the pixel/barycentric (default).
|
static |
Backing store for the Right attached property.
Gets/sets the offset from the right border for a child element.
Default is double.NaN for not used.
|
static |
Backing store for the Top attached property.
Gets/sets the offset from the top for a child element.
Default is double.NaN for not used.
|
get |
Gets the rendered zoom center of this display.
This is the actual value of the rendered control. Default is a point with double.NaN coordinates.
This property is a calculated value based on the ZoomCenter and System.Windows.FrameworkElement.ActualWidth and System.Windows.FrameworkElement.ActualHeight by the layout system. The value is set by the layout system itself, based on an actual rendering pass, and may therefore lag slightly behind the set value of properties such as ZoomFactor that are the basis of the input change.
Because this value is calculated, you should be aware that there could be multiple or incremental reported changes to it as a result of various operations by the layout system. The layout system may be calculating required measure space for child elements, constraints by the parent element, and so on.
Implements IDisplay.
|
get |
Gets the rendered zoom factor of this display.
This is the actual value of the rendered control. Default is double.NaN.
This property is a calculated value based on the ZoomFactor and System.Windows.FrameworkElement.ActualWidth and System.Windows.FrameworkElement.ActualHeight by the layout system. The value is set by the layout system itself, based on an actual rendering pass, and may therefore lag slightly behind the set value of properties such as ZoomFactor that are the basis of the input change.
Because this value is calculated, you should be aware that there could be multiple or incremental reported changes to it as a result of various operations by the layout system. The layout system may be calculating required measure space for child elements, constraints by the parent element, and so on.
Implements IDisplay.
|
get |
Gets the vertical size of the image, including the content that is not visible, in device independent pixels.
A System.Double that represents, in device independent pixels, the full vertical size of the image.
|
get |
Gets the horizontal size of the image, including the content that is not visible, in device independent pixels.
A System.Double that represents, in device independent pixels, the full horizontal size of the image.
|
getset |
Gets or sets the minimal frame time for displaying new frames.
This time defines the minimal duration a frame is displayed. This means that redraw operations are postponed to this value's duration since the last redraw. This effectively reduces the display frame rate.
Default is no minimal frame time.
|
get |
Gets the horizontal offset of the scrolled content.
A System.Double that represents, in device independent pixels, the horizontal offset.
Valid values are between zero and the ExtentWidth minus the ViewportWidth.
Gets/sets a Stemmer.Cvb.Image as the image source of this display.
If this property is set the ImageSource property is readonly.
Implements IDisplay.
|
get |
Gets the observer to receive new Image pushes.
If multiple Images are to be displayed in one render phase, only the newest is rendered.
It is safe to push see Stemmer.Cvb.Images from non-UI threads.
|
getset |
Image source of this display.
If DisplayCanvas.Image is set, this property is readonly.
Implements IDisplay.
|
get |
Gets the the displayed image region shown width.
Shown part of the image in device independent pixels.
|
get |
Gets the horizontal offset to the displayed image.
Horizontal offset from the canvas' left border in device independent pixels.
|
get |
Gets the vertical offset to the displayed image.
Vertical offset from the canvas' top border in device independent pixels.
|
get |
Gets the the displayed image region shown width.
Shown part of the image in device independent pixels.
|
get |
|
get |
Gets whether this control is currently in zoom mode despite stretch mode.
This control is either in zoom mode (true
value) or in panorama/stretch mode (false
value).
Implements IDisplay.
|
get |
Gets the size of one ImageSource pixel.
Size in device independent pixels; double.NaN if no display is possible.
|
getset |
Gets/sets whether the display is to be redrawn as soon as the image data has been updated.
Default is true
.
|
get |
Gets the zoom factor as if in the case as if this control would be in stretch mode.
The zoom factor that would be
Implements IDisplay.
|
get |
Gets the vertical offset of the scrolled content.
A System.Double that represents, in device independent pixels, the vertical offset.
Valid values are between zero and the ExtentHeight minus the ViewportHeight.
|
get |
Gets the vertical size of the view port for this content.
A System.Double that represents, in device independent pixels, the visible vertical size of the image.
|
get |
Gets the horizontal size of the view port for this content.
A System.Double that represents, in device independent pixels, the visible horizontal size of the image.
|
getset |
Gets/sets the zoom center.
Point in the bitmap source which is the center of the zoomed view port. Coordinates are in bitmap pixels.
Implements IDisplay.
|
getset |
The current zoom factor of the image.
A zoom factor larger than 1.0 magnifies the displayed image; values smaller than 1.0 zoom out whereas 1.0 displays the image as is (this resembles System.Windows.Media.Stretch.None). The special value 0.0 identifies the panorama or stretch mode which resembles System.Windows.Media.Stretch.Uniform (the default). Values smaller 0.0 are invalid.
To get the actual value, e.g. in panorama/stretch mode, use the ActualZoomFactor property.
Implements IDisplay.
|
get |
The transform affecting the zoom parameters.
Default value is the Transform.Identity transform.
The behavior is like the render transform of a UIElement as the actual ZoomCenter and ZoomFactor values are not changed.