Skip to content

Commit

Permalink
use writable dir
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed May 8, 2024
1 parent bae4232 commit 4cf46e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom-base-image/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public static void Main(string[] args)
// encode the image as a PNG
var data = image.Encode(SKEncodedImageFormat.Png, 100);
// save the PNG to disk
using (var stream = File.OpenWrite("output.png"))
var userHome = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var outputPng = Path.Combine(userHome, "output.png");
using (var stream = File.OpenWrite(outputPng))
{
// copy the encoded image into the file stream
data.SaveTo(stream);
Expand Down

0 comments on commit 4cf46e0

Please sign in to comment.