Skip to content

Commit

Permalink
Compare pixel formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Nov 8, 2020
1 parent ea4485f commit d8ae7b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Desktop.Core/Utilities/ImageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ public static List<Rectangle> GetDiffAreas(Bitmap currentFrame, Bitmap previousF
{
throw new Exception("Bitmaps are not of equal dimensions.");
}
if (!Bitmap.IsAlphaPixelFormat(currentFrame.PixelFormat) || !Bitmap.IsAlphaPixelFormat(previousFrame.PixelFormat) ||
!Bitmap.IsCanonicalPixelFormat(currentFrame.PixelFormat) || !Bitmap.IsCanonicalPixelFormat(previousFrame.PixelFormat))
if (currentFrame.PixelFormat != previousFrame.PixelFormat)
{
throw new Exception("Bitmaps must be 32 bits per pixel and contain alpha channel.");
throw new Exception("Bitmaps are not the same format.");
}
var width = currentFrame.Width;
var height = currentFrame.Height;
Expand Down

0 comments on commit d8ae7b8

Please sign in to comment.