Skip to content

Commit

Permalink
Merge pull request Krypton-Suite#1974 from Krypton-Suite/1964-alpha-K…
Browse files Browse the repository at this point in the history
…TreeView-Node-Scaling

- `KryptonTreeView` Node crosses are now Dpi Scaled
  • Loading branch information
PWagner1 authored Dec 18, 2024
2 parents 9ac4d9e + 3081f4a commit 9d772fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=======

## 2025-11-xx - Build 2511 - November 2025
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Implemented [#1968](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1968), Open up 'ExceptionHandler' for public use
- To invoke, use `KryptonExceptionHandler`
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
Expand Down Expand Up @@ -43,6 +44,7 @@
=======

## 2025-02-01 - Build 2502 (Version 95 - Patch 1) - February 2025
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
* Resolved [#565](https://github.com/Krypton-Suite/Standard-Toolkit/issues/565), GroupBox icons are not scaled for dpi awareness
* Resolved [#559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/559), Header group icon is not scaled for dpi awareness
Expand Down Expand Up @@ -229,6 +231,7 @@
=======

# 2025-02-01 - Build 2502 (Patch 5) - February 2025
* Resolved [#1964](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1964), `KryptonTreeView` Node crosses are not Dpi Scaled
* Resolved [#560](https://github.com/Krypton-Suite/Standard-Toolkit/issues/560), CheckBox Images are not scaled with dpi Awareness
* Resolved [#565](https://github.com/Krypton-Suite/Standard-Toolkit/issues/565), GroupBox icons are not scaled for dpi awareness
* Resolved [#559](https://github.com/Krypton-Suite/Standard-Toolkit/issues/559), Header group icon is not scaled for dpi awareness
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,10 @@ private void OnTreeViewDrawNode(object? sender, DrawTreeNodeEventArgs e)
Image? drawImage = _redirectImages!.GetTreeViewImage(e.Node.IsExpanded);
if (drawImage != null)
{
float dpiFactor = g.DpiX / 96F;
drawImage = CommonHelper.ScaleImageForSizedDisplay(drawImage,
drawImage.Width * dpiFactor,
drawImage.Height * dpiFactor, false)!;
g.DrawImage(drawImage, new Rectangle(indentBounds.X + ((indentBounds.Width - drawImage.Width) / 2) - 1,
indentBounds.Y + ((indentBounds.Height - drawImage.Height) / 2),
drawImage.Width, drawImage.Height));
Expand Down Expand Up @@ -2335,6 +2339,10 @@ private void OnTreeViewDrawNode(object? sender, DrawTreeNodeEventArgs e)

if (drawImage != null)
{
float dpiFactor = g.DpiX / 96F;
drawImage = CommonHelper.ScaleImageForSizedDisplay(drawImage,
drawImage.Width * dpiFactor,
drawImage.Height * dpiFactor, false)!;
g.DrawImage(drawImage, _layoutImage.ClientRectangle);
}
}
Expand All @@ -2349,6 +2357,10 @@ private void OnTreeViewDrawNode(object? sender, DrawTreeNodeEventArgs e)
{
if (drawStateImage != null)
{
float dpiFactor = g.DpiX / 96F;
drawStateImage = CommonHelper.ScaleImageForSizedDisplay(drawStateImage,
drawStateImage.Width * dpiFactor,
drawStateImage.Height * dpiFactor, false)!;
g.DrawImage(drawStateImage, _layoutImageState.ClientRectangle);
}
}
Expand Down

0 comments on commit 9d772fb

Please sign in to comment.