FlexCelPreview Class
A Simple replacement for PrintPreviewControl that allows you to preview even if the user has no printers installed. View the demo on Custom Preview to see how it is used.
Syntax
Namespace: FlexCel.Winforms
public class FlexCelPreview: UserControl
Constructors
| Name | Description |
|---|---|
| FlexCelPreview | Creates a new instance of FlexCelPreview. |
Methods
| Name | Description |
|---|---|
| AutofitPreviewOnce | Use this method to do a single autofit. If you want the preview to be in "autofit mode" so it keeps autofitting even if you resize the window, set AutofitPreview instead. |
| Dispose | Clean up any resources being used. |
| InvalidatePreview | Invalidates the preview and forces the control to reload from the document. When the control is a Thumbnail you cannot Invalidate it, this will be done automatically when you invalidate the main view. |
| OnFontChanged | Overrides the OnfontChanged event. |
| OnMouseDown | Overrides the standard mousedown event to handle it. |
| OnPaint | Overrides the OnPaint event. |
| OnResize | Overrides de OnResize method. |
| OnStartPageChanged | Replace this event when creating a custom descendant of FlexCelPreview. |
| OnZoomChanged | Replace this event when creating a custom descendant of FlexCelPreview. |
| ProcessCmdKey | Overrides the ProcessCmdKey event. |
Properties
| Name | Description |
|---|---|
| AutofitPreview | Defines if the page will be automatically zoomed to fit in the preview. Note that zoom will never be less than 10% or 400%. If you want to autofit just once, call AutofitPreviewOnce instead. |
| AutoScroll | Indicates whether scrollbars appear automatically when needed. |
| BackColor | Background color for the preview. |
| CacheSize | The cache size in number of pages stored at 100% zoom. For larger zoom, the actual number of pages is decreased by (Zoom*Zoom) |
| CenteredPreview | When true, the preview will be drawn at the middle of the window, instead of at the left. If true, then PageXSeparation is the minimum margin that the preview will have. |
| Document | Document to be Previewed. |
| EndPreviewAtLastPage | When true, the preview will stop at the last page, and if you are showing more than one page at the same time you won't be able to select the last page. When false, FlexCelPreview will add enough space after the last page so all pages are selectable. Note that in normal cases this won't make a difference, this property only applies if zoom is so small that you can see more than one page in the preview. |
| InterpolationMode | This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information |
| MaxPageSize | Returns the maximum height and width of a page. Note that width and height might not be from the same page, this is the width of the widest page and the height of the tallest page. |
| PageBorderColor | Border color for the pages in the preview. |
| PageBorderStyle | Border style for the pages in the preview. |
| PageBorderWidth | Border width for the pages in the preview. |
| PageNumberBgColor | Background color for the page numbers in the thumbnail view. |
| PageNumberSelectedBgColor | Background color for the selected page number in the thumbnail view. |
| PageNumberSelectedTextColor | Text color for the selected page number in the thumbnail view. |
| PageNumberTextColor | Text color for the page number in the thumbnail view. |
| PageShadowColor | Shadow color for the pages in the preview. |
| PageShadowSize | Shadow size for the pages in the preview. Set it to 0 to disable shadows. |
| PageXSeparation | Separation (in display units) between a page and the next. Note that if CenteredPreview is true and the preview window is bigger than the page being displayed, this value has no effect. |
| PageYSeparation | Separation (in display units) between a page an the next. |
| ScreenResolution | Returns the screen resolution being used. |
| ScreenScale | This is the ScreenResoulution divided by 96. So an screen with 100% magnification (96 dpi) will have a ScreenScale of 1, while a screen with 200% magnification will have a ScreenScale of 2. |
| ShowThumbsPageNumber | If true, the thumbnails will display the page number. Note that this property only affects the thumbnails, not the main preview. |
| SmoothingMode | This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information |
| StartPage | Page the preview is showing. |
| ThumbnailLarge | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the large Thumbnail images. |
| ThumbnailSmall | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the small Thumbnail images. |
| TotalPages | Number of pages displaying. |
| Zoom | Zoom preview. |
Events
| Name | Description |
|---|---|
| StartPageChanged | Fires when the starting page changes. |
| ZoomChanged | Fires when the Zoom changes. (for example, the user uses ctrl+MouseWeel). |