Skip to content
Snippets Groups Projects
Commit 11fe5255 authored by Nick Kozel's avatar Nick Kozel
Browse files

fixing resizing of gifs when loaded

parent 5c06015f
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.Location = new System.Drawing.Point(12, 399);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 42);
......
......@@ -14,6 +14,8 @@ namespace Gifitti
public partial class Form1 : Form
{
// GifImage _currentGif; <- used to encapsulate info later
private const int widthBuffer = 20;
private const int heightBuffer = 60;
public Form1()
{
......@@ -29,10 +31,13 @@ namespace Gifitti
string file = openFileDialog1.FileName;
try
{
gifView.Image = Image.FromFile(file);
Image temp = Image.FromFile(file);
ClientSize = new Size(temp.Width, temp.Height);
Image loadedGif = Image.FromFile(file);
gifView.Image = loadedGif;
gifView.Width = loadedGif.Width;
gifView.Height = loadedGif.Height;
ClientSize = new Size(loadedGif.Width+widthBuffer, loadedGif.Height+heightBuffer);
}
catch (IOException)
{
}
......
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment