The图像放大eViewerrendering cycle supports full customization. The various events and their data allow for any of the following:
Add user-defined rendering code on the view or the items. For example, the LEADTOOLS annotations framework hooks to the rendering cycle to draw the annotations container on top of an item.
Perform full owner drawing of any part of the view or item. For example, the图像放大eViewerVirtualizerhooks to the render event to draw a place holder when the image data is not present yet.
Re-direct the rendering to an external context. For example, the图像放大eViewerPanControluses redirection to duplicate the current appearance of the viewer to an external control.
The rendering cycle occurs when图像放大eViewer.Invalidateor图像放大eViewer.RenderRedirectis called due to normal control painting or a response to图像放大eViewer.UpdateTransform. To customize the rendering cycle, you can either subscribe to the specific event or derive from the图像放大eViewerand override the specific virtual method. All these methods and event use the图像放大eViewerRenderEventArgsclass to hold the information needed.
图像放大eViewerRenderEventArgscontains the following:
Member | Description |
---|---|
Context | In Windows Forms, the In JavaScript, the HTML |
PaintEventArgs | Original Windows.Forms paint arguments if this render event is in response to |
Item | The item being rendered or null of this part of the rendering cycle is view-specific. |
Part | The item part being rendered or View if this part of the rendering cycle is is view-specific. |
错误 | An error that was caught during the rendering cycle. Used with the图像放大eViewer.RenderErrorevent. |
ImageViewerRenderEventArgs。ClipRectangle | Current clipping rectangle to be applied. |
The image viewer will call the virtual methods and fires the events in the order described below. Note for members,ImageViewerRenderEventArgs。Contexwill point to theSystem.Drawing.Graphics
(in Windows.Forms) or (HTMLCanvasContext2D
object for the fore canvas in JavaScript) the viewer control or the redirect target.
Method - Event | ImageViewerRenderEventArgs。Item,Part | Default Operations |
---|---|---|
图像放大eViewer.OnEraseBackground -图像放大eViewer.EraseBackground JavaScript only |
null-图像放大eViewerItem.View |
Erases or clears the background |
OnPreRender-PreRender | null-图像放大eViewerItem.View |
Nothing. Can be used to set the context properties (for example, anti-aliasing or interpolation quality) |
OnRenderShadow-RenderShadow | null-图像放大eViewerItem.View |
Renders the drop shadow of the view |
OnRenderBorder-RenderBorder | null-图像放大eViewerItem.View |
Renders the border of the view |
For each item | Loops through the items in the viewer. Only occur if the item isIsVisible, has none empty图像放大eSizeand if it intersects with the current visible viewer surface and clipping rectangle. |
|
OnPreRenderItem-PreRenderItem | The item - Item |
Nothing |
OnRenderItem-RenderItem | The item - Item |
Nothing |
OnRenderBackground-RenderBackground | The item - Item |
Fills the content of the item with the background color based on the item state |
OnRenderBorder-RenderBorder | The item - Content |
Renders the content border using the border color based on the item state |
OnRenderShadow-RenderShadow | The item - Image |
Renders the drop shadow around the image of the item |
OnRenderImage-RenderImage | The item - Image |
Renders the item image |
OnRenderBorder-RenderBorder | The item - Image |
Renders the border of the image |
OnRenderText-RenderText | The item - Text |
Renders the text of the item |
OnPostRenderItem-PostRenderItem | The item - Item |
Nothing |
Next item | ||
OnPostRender-PostRender | null-图像放大eViewerItem.View |
Renders the floaters and regions |
OnRedirectRender-RedirectRender | null-图像放大eViewerItem.View |
Nothing |
The most common custom rendering is performed by subscribing to these events:
PostRenderItem: To render extra information on top of an item
PostRender: To render extra information on top of the whole viewer
Refer to these events for an example.
To manually trigger a new rendering cycle, call图像放大eViewer.Invalidateto invalidate a portion of the whole surface of the viewer. This method accepts a rectangle that specifies the portion of the viewer to update for optimal speed. TheInvalidateItemorInvalidateItemByIndexmethods can be used to re-render a single item quickly.
Rendering of the图像放大eViewercontrol normally occurs automatically and not through any code called by the user. If an error occur, the user does not have the ability to try/catch the exception and process the error. Therefore,图像放大eViewercontains theRenderErrorevents. This will occur when an error happens in the internal rendering cycle. The event uses the same图像放大eViewerRenderEventArgsdata class, so all the usual parameters of what item and part caused the error are passed to the user. In addition, it will catch the error and set it in theImageViewerRenderEventArgs。错误property.
The ImageViewer also supports the following operations related to rendering:
Member | Description |
---|---|
Invert | Display all items with inverted colors |
ScreenDpi | Update the value of the screen resolution in dots per inch |
UseDpi | Account for the resolution of the image in the items when calculating the display size |
AspectRatioCorrection | Manually change the aspect ratio used to compensate for non-square pixels |
BeginRender | Temporally disable rendering |
EndRender | Re-enable rendering |
图像放大eViewer.Invalidate | Request that the viewer re-renders the whole or part of the view |
PaintProperties | Controls the quality used when rendering RasterImage objects |
RedirectRender | Render the current view to an external context |
ClipImageToContent | Display only the part of the image inside its content if the item transformation result in a larger boundary |
OwnerDraw | Turn off or on all automatic rendering of view and items |
使用图像放大e Viewer with Windows.Forms
图像放大e Viewer Bounds and Transform
图像放大e Viewer Rendering
Help Collections
Raster.NET|C API|C++ Class Library|HTML5 JavaScript
Document.NET|C API|C++ Class Library|HTML5 JavaScript
Medical.NET|C API|C++ Class Library|HTML5 JavaScript
Medical Web Viewer.NET
188宝金博怎么下载
Media Foundation.NET|C API|Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
图像放大ing, Medical, and Document
C API/C++ Class Libraries
图像放大ing, Medical, and Document
HTML5 JavaScript Libraries
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.