using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GMLL00ImportadorXsd.Presentacion
{
    public partial class FrmFotoAmpliada : Form
    {

        private Bitmap MyImage;


        public FrmFotoAmpliada(String fileToDisplay)
        {
            InitializeComponent();
            ShowMyImage(pBFotoAmpliada, fileToDisplay);
        }

        

        private void btnCerrar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        private void ShowMyImage(PictureBox pB, String fileToDisplay)
        {                                
            if (MyImage != null)
            {
                MyImage.Dispose();
            }
            
            pB.SizeMode = PictureBoxSizeMode.StretchImage;
            MyImage = new Bitmap(fileToDisplay);
            pB.ClientSize = new Size(MyImage.Size.Width, MyImage.Size.Height);


            pB.Image = (System.Drawing.Image)MyImage;
            pB.Visible = true;
        }

        private void FrmFotoAmpliada_Load(object sender, EventArgs e)
        {

        }
    }
}
