mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2025-12-06 17:15:42 -08:00
Catch errors in writing image
This commit is contained in:
@@ -339,8 +339,12 @@ public class Setup {
|
|||||||
g.DrawImageUnscaledAndClipped(img, new Rectangle(Point.Empty, img.Size));
|
g.DrawImageUnscaledAndClipped(img, new Rectangle(Point.Empty, img.Size));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
bmp.Save(newName, ImageFormat.Bmp);
|
var ms = new MemoryStream();
|
||||||
} catch {
|
bmp.Save(ms, ImageFormat.Bmp);
|
||||||
|
var bytes = ms.ToArray();
|
||||||
|
File.WriteAllBytes(newName, bytes);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log($"InstallImageFile failed: {e.ToString()}");
|
||||||
throw new SetupException($"Failed to install image {name} to {newName}.");
|
throw new SetupException($"Failed to install image {name} to {newName}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user