Skip to content

Commit

Permalink
Fix image opacity in WinForms and Core Drawing (#1766) (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualMelon committed May 14, 2021
1 parent b392a61 commit 46a4b9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file.
- Zero-crossing axis bounds (#1708)
- Incorrect label placement on BarSeries with non-zero BaseValue (#1726)
- LineAnnotation Text Placement on Reversed Axes (#1741)
- Image opacity in WinForms and Core Drawing (#1766)

## [2.1.0-Preview1] - 2020-10-18

Expand Down
14 changes: 7 additions & 7 deletions Source/OxyPlot.WindowsForms/GraphicsRenderContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ public override void DrawImage(OxyImage source, double srcX, double srcY, double
if (opacity < 1)
{
var cm = new ColorMatrix
{
Matrix00 = 1f,
Matrix11 = 1f,
Matrix22 = 1f,
Matrix33 = 1f,
Matrix44 = (float)opacity
};
{
Matrix00 = 1f,
Matrix11 = 1f,
Matrix22 = 1f,
Matrix33 = (float)opacity,
Matrix44 = 1f
};

ia = new ImageAttributes();
ia.SetColorMatrix(cm, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
Expand Down

0 comments on commit 46a4b9c

Please sign in to comment.