Skip to content

Commit d972496

Browse files
author
Wayfarer
committed
Last touch Ups.
1 parent 1f2797d commit d972496

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Imaging/DirectBitmapImage.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ public DirectBitmapImage(Pixel32[] bits, int width)
8585
if (width <= 0) throw new ArgumentOutOfRangeException(nameof(width));
8686
if (bits.Length % width != 0) throw new ArgumentException("Pixel array length must be divisible by width.");
8787

88+
_cachedImage = null;
89+
8890
int height = bits.Length / width;
8991
Bits = bits;
92+
_bitsHandle = GCHandle.Alloc(Bits, GCHandleType.Pinned);
9093
_bitmap = new WriteableBitmap(width, height, 96, 96, PixelFormats.Bgra32, null);
94+
UpdateBitmapFromBits();
9195
}
9296

9397
/// <summary>

0 commit comments

Comments
 (0)