Skip to content

Commit

Permalink
Create Bitmap object from imagePath and assign into anyBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
bline-ironsoftware committed Jun 5, 2024
1 parent bd2fc1b commit 7d012a1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using SixLabors.ImageSharp.Processing;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
using Image = SixLabors.ImageSharp.Image;

namespace IronSoftware.Drawing.Common.Tests.UnitTests
{
Expand Down Expand Up @@ -412,7 +414,7 @@ public void CastBitmap_to_AnyBitmap_using_FromBitmap()
{
string imagePath = GetRelativeFilePath("van-gogh-starry-night-vincent-van-gogh.jpg");
var imgSharp = Image.Load<Rgba32>(imagePath);
var anyBitmap = AnyBitmap.FromBitmap(imgSharp);
var anyBitmap = AnyBitmap.FromBitmap(new Bitmap(imagePath));

imgSharp.Save("expected.png");
anyBitmap.SaveAs("result.png");
Expand Down

0 comments on commit 7d012a1

Please sign in to comment.