Skip to content

Commit

Permalink
ImageExtensions - Renamed 'ResizeImage' to 'Resize'
Browse files Browse the repository at this point in the history
  • Loading branch information
NessieHax committed Aug 3, 2023
1 parent 8b7d71f commit afb01e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions PCK-Studio/Extensions/ImageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ private static Size CalculateImageSize(IList<Image> sources, ImageLayoutDirectio
return new Size(width, height);
}

internal static Image ResizeImage(this Image image, Size size, GraphicsConfig graphicsConfig)
internal static Image Resize(this Image image, Size size, GraphicsConfig graphicsConfig)
{
return image.ResizeImage(size.Width, size.Height, graphicsConfig);
return image.Resize(size.Width, size.Height, graphicsConfig);
}

internal static Image ResizeImage(this Image image, int width, int height, GraphicsConfig graphicsConfig)
internal static Image Resize(this Image image, int width, int height, GraphicsConfig graphicsConfig)
{
var destRect = new Rectangle(0, 0, width, height);
var destImage = new Bitmap(width, height);
Expand Down
3 changes: 1 addition & 2 deletions PCK-Studio/Forms/Editor/TextureAtlasEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private void SetTile(Image texture)
PixelOffsetMode = PixelOffsetMode.HighQuality
};
if (texture.Size != _areaSize)
texture = texture.ResizeImage(_areaSize, graphicsConfig);
texture = texture.Resize(_areaSize, graphicsConfig);
using (var g = Graphics.FromImage(originalPictureBox.Image))
{
g.ApplyConfig(graphicsConfig);
Expand Down Expand Up @@ -348,7 +348,6 @@ protected override bool ProcessDialogKey(Keys keyData)
}

return false;
// return base.ProcessDialogKey(keyData);
}
}
}
6 changes: 3 additions & 3 deletions PCK-Studio/Forms/Utilities/pckCenterOpen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,15 +1034,15 @@ private void convertToBedrockToolStripMenuItem_Click(object sender, EventArgs e)

if (saveSkin.Width == saveSkin.Height)
{
saveSkin.ResizeImage(64, 64, config);
saveSkin.Resize(64, 64, config);
}
else if (saveSkin.Height == saveSkin.Width / 2)
{
saveSkin.ResizeImage(64, 32, config);
saveSkin.Resize(64, 32, config);
}
else
{
saveSkin.ResizeImage(64, 64, config);
saveSkin.Resize(64, 64, config);
}
saveSkin.Save(root + "/" + skinTexture.Filename, ImageFormat.Png);
}
Expand Down

0 comments on commit afb01e6

Please sign in to comment.