ImageViewerOptimizationOptions Enumeration
Namespace: KGySoft.WinForms.ControlsAssembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
[FlagsAttribute]
public enum ImageViewerOptimizationOptions
<FlagsAttribute>
Public Enumeration ImageViewerOptimizationOptions
[FlagsAttribute]
public enum class ImageViewerOptimizationOptions
[<FlagsAttribute>]
type ImageViewerOptimizationOptions
| None | 0x00 |
No optimizations are applied. This consumes the least memory and is the slowest option.
|
| UseOptimalPixelFormat | 0x01 |
Specifies that the ImageViewer may generate an image internally with an optimal pixel format for rendering.
|
| GenerateResizedBitmap | 0x02 |
When this option is set and an image is displayed with a Zoom value less than 1.0, the ImageViewer may generate a resized bitmap of the image for rendering.
This happens asynchronously in the background. Until the resized bitmap is generated, a lower quality rendering is used.
|
| CheckQuicklyAvailableMemory | 0x04 |
Determines whether the ImageViewer should check the quickly available memory (that is, the freely available physical memory without paging)
before applying optimizations specified by the other options. If the check fails, the optimizations are not applied, and the ImageViewer
will use a slower rendering method that consumes less memory. When this option is not set, the ImageViewer will always try to apply optimizations,
which may lead to paging and high memory consumption. Even if this option is not set, optimizations are automatically disabled when the required unmanaged memory cannot be allocated.
|
| Default | 0x07 |
Specifies the default optimization options for the ImageViewer control, which includes the following:
UseOptimalPixelFormat, GenerateResizedBitmap and CheckQuicklyAvailableMemory.
|
| UseUnsafeCooperativeLocking | 0x08 |
Specifies that the ImageViewer is allowed to access the Image on a background thread.
When this option is disabled, ImageViewer may clone Image internally to generate a resized image in the background, which means more memory consumption.
This option is for advanced users only. If you assign the same Image instance to other controls than ImageViewer instances,
this option must be disabled, because it may lead to exceptions ("bitmap region is already locked").
You still can access the Image from other threads if you cooperatively lock on the Image instance.
Please note that using a shared synchronization root object needs to be handled carefully to avoid deadlocks.
Do not wait for events from the UI thread while holding the lock.
|