Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion quick-picture-viewer/forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,10 @@ public void cropBtn_Click(object sender, EventArgs e)
{
if (selForm != null && originalImage != null)
{
originalImage = originalImage.Clone(GetSelectionRect(), originalImage.PixelFormat);
Bitmap oldImage = originalImage;
originalImage = oldImage.Clone(GetSelectionRect(), oldImage.PixelFormat);
pictureBox.Image = originalImage;
oldImage.Dispose();
setImageChanged(true);
UpdateSizeLabel();
pictureBox.UpdatePictureBoxLocation(picturePanel);
Expand Down
10 changes: 7 additions & 3 deletions quick-picture-viewer/typewrappers/BitmapWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ public override FileTypeMan.OpenResult Open(string path)
{
try
{
return new FileTypeMan.OpenResult
using (var ms = new MemoryStream(File.ReadAllBytes(path)))
using (var tmp = new Bitmap(ms))
{
Bmp = new Bitmap(path)
};
return new FileTypeMan.OpenResult
{
Bmp = new Bitmap(tmp)
};
}
}
catch
{
Expand Down
9 changes: 6 additions & 3 deletions quick-picture-viewer/typewrappers/IcoWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ public override FileTypeMan.OpenResult Open(string path)
{
try
{
return new FileTypeMan.OpenResult
using (var icon = new Icon(path, 128, 128))
{
Bmp = new Icon(path, 128, 128).ToBitmap()
};
return new FileTypeMan.OpenResult
{
Bmp = icon.ToBitmap()
};
}
}
catch
{
Expand Down