Class BitmapScaleHandler<TKey>
This provides bitmaps scaled according to the current DPI. If the DPI changes, it will reapply the bitmaps and dispose the old ones (if needed).
Inheritance
System.Object
BitmapScaleHandler<TKey>
Namespace: Dapplo.Windows.Dpi
Assembly: Dapplo.Windows.Dpi.dll
Syntax
public sealed class BitmapScaleHandler<TKey> : IDisposable
Type Parameters
| Name | Description |
|---|---|
| TKey |
Methods
| Improve this Doc View SourceAddApplyAction(Action<Bitmap>, TKey, Boolean)
Add an action which applies a bitmap
Declaration
public void AddApplyAction(Action<Bitmap> apply, TKey imageKey, bool execute = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<Bitmap> | apply | Action which assigns a bitmap |
| TKey | imageKey | key of the image |
| System.Boolean | execute | Execute specifies if the assignment needs to be done right away |
AddTarget(Button, TKey, Boolean)
Add a Button as a Bitmap target
Declaration
public void AddTarget(Button button, TKey imageKey, bool execute = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Button | button | Button |
| TKey | imageKey | key of the image |
| System.Boolean | execute | Execute specifies if the assignment needs to be done right away |
AddTarget(ToolStripItem, TKey, Boolean)
Add a ButtonToolStripItem as a Bitmap target
Declaration
public void AddTarget(ToolStripItem toolStripItem, TKey imageKey, bool execute = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ToolStripItem | toolStripItem | ToolStripItem |
| TKey | imageKey | key of the image |
| System.Boolean | execute | Execute specifies if the assignment needs to be done right away |
Dispose()
Dispose implementation
Declaration
public void Dispose()
Finalize()
Declaration
protected void Finalize()
RemoveTarget(Object)
Remove a previously added target for being updated. This will not update the image, or remove it right away.
Declaration
public void RemoveTarget(object target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | target |