commit d258be4ebd5f7f88879ae80d7db72ebfccdc4b15 Author: Valeriano A.R Date: Thu Dec 24 11:53:23 2015 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9009feb --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.exe +*.pdb +*/bin/* +*/obj/* +*.user +.vs diff --git a/ImageView.sln b/ImageView.sln new file mode 100644 index 0000000..934fc7a --- /dev/null +++ b/ImageView.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageView", "ImageView\ImageView.csproj", "{B1B8280E-A303-4E09-892D-382A6AB206E3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B1B8280E-A303-4E09-892D-382A6AB206E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1B8280E-A303-4E09-892D-382A6AB206E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1B8280E-A303-4E09-892D-382A6AB206E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1B8280E-A303-4E09-892D-382A6AB206E3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ImageView/Controls/CtrImageViewer.cs b/ImageView/Controls/CtrImageViewer.cs new file mode 100644 index 0000000..7b0f545 --- /dev/null +++ b/ImageView/Controls/CtrImageViewer.cs @@ -0,0 +1,125 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ImageView.Controls +{ + public class CtrImageViewer : PictureBox + { + #region Declarations + + Image _imageShow = null; + + // Image projection + private double offsetX = 0; + private double offsetY = 0; + private double scaleX = 1.0f; + private double scaleY = 1.0f; + + #endregion + + #region Properties + + public Image ImageShow + { + get { return _imageShow; } + set + { + lock (this) + { + _imageShow = value; + this.Invalidate(); + } + } + } + + #endregion + + #region Control life cycle + + public CtrImageViewer() + { + BackColor = Color.Black; + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + Redraw(pe.Graphics); + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + //Redraw(null); + this.Invalidate(); + } + + #endregion + + #region Private methods + + private void Redraw(Graphics graph) + { + if (_imageShow == null) + { + return; + } + lock (_imageShow) + { + if (graph == null) + { + graph = this.CreateGraphics(); + } + + // Calcular dimensiones a dibujar y centrar + int imgDrawWidth; + int imgDrawHeight; + float imgDrawX = 0; + float imgDrawY = 0; + float relation = (float)_imageShow.Width / (float)_imageShow.Height; + if (relation > 0) + { + // Imagen mas ancha que alta + imgDrawHeight = (int)(this.Width / relation); + if (imgDrawHeight > this.Height) + { + imgDrawHeight = this.Height; + imgDrawWidth = (int)(this.Height * relation); + imgDrawX = ((this.Width - imgDrawWidth) / 2.0f); + } + else + { + imgDrawWidth = this.Width; + imgDrawY = ((this.Height - imgDrawHeight) / 2.0f); + } + } + else + { + // Imagen mas alta que ancha + imgDrawWidth = (int)(this.Width * relation); + if (imgDrawWidth > this.Width) + { + imgDrawWidth = this.Width; + imgDrawHeight = (int)(this.Height / relation); + imgDrawY = ((this.Height - imgDrawHeight) / 2.0f); + } + else + { + imgDrawHeight = this.Height; + imgDrawX = ((this.Width - imgDrawWidth) / 2.0f); + } + } + + graph.DrawImage(_imageShow, imgDrawX, imgDrawY, imgDrawWidth, imgDrawHeight); + offsetX = imgDrawX; + offsetY = imgDrawY; + scaleX = (double)imgDrawWidth / (double)_imageShow.Width; + scaleY = (double)imgDrawHeight / (double)_imageShow.Height; + } + } + + #endregion + + } +} diff --git a/ImageView/FrmImageView.Designer.cs b/ImageView/FrmImageView.Designer.cs new file mode 100644 index 0000000..ec506fa --- /dev/null +++ b/ImageView/FrmImageView.Designer.cs @@ -0,0 +1,109 @@ +namespace ImageView +{ + partial class FrmImageView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmImageView)); + this.btnNext = new System.Windows.Forms.Button(); + this.btnPrev = new System.Windows.Forms.Button(); + this.btnSelectInExplorer = new System.Windows.Forms.Button(); + this.picImageView = new ImageView.Controls.CtrImageViewer(); + ((System.ComponentModel.ISupportInitialize)(this.picImageView)).BeginInit(); + this.SuspendLayout(); + // + // btnNext + // + this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnNext.Location = new System.Drawing.Point(576, 521); + this.btnNext.Name = "btnNext"; + this.btnNext.Size = new System.Drawing.Size(75, 23); + this.btnNext.TabIndex = 1; + this.btnNext.Text = "Next"; + this.btnNext.UseVisualStyleBackColor = true; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnPrev + // + this.btnPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnPrev.Location = new System.Drawing.Point(13, 521); + this.btnPrev.Name = "btnPrev"; + this.btnPrev.Size = new System.Drawing.Size(75, 23); + this.btnPrev.TabIndex = 2; + this.btnPrev.Text = "Prev"; + this.btnPrev.UseVisualStyleBackColor = true; + this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click); + // + // btnSelectInExplorer + // + this.btnSelectInExplorer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnSelectInExplorer.Location = new System.Drawing.Point(94, 521); + this.btnSelectInExplorer.Name = "btnSelectInExplorer"; + this.btnSelectInExplorer.Size = new System.Drawing.Size(94, 23); + this.btnSelectInExplorer.TabIndex = 3; + this.btnSelectInExplorer.Text = "SelectInExplorer"; + this.btnSelectInExplorer.UseVisualStyleBackColor = true; + this.btnSelectInExplorer.Click += new System.EventHandler(this.btnSelectInExplorer_Click); + // + // picImageView + // + this.picImageView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.picImageView.BackColor = System.Drawing.Color.Black; + this.picImageView.ImageShow = null; + this.picImageView.Location = new System.Drawing.Point(0, 0); + this.picImageView.Name = "picImageView"; + this.picImageView.Size = new System.Drawing.Size(664, 515); + this.picImageView.TabIndex = 0; + this.picImageView.TabStop = false; + // + // FrmImageView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(663, 550); + this.Controls.Add(this.btnSelectInExplorer); + this.Controls.Add(this.btnPrev); + this.Controls.Add(this.btnNext); + this.Controls.Add(this.picImageView); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "FrmImageView"; + this.Text = "ImageView"; + ((System.ComponentModel.ISupportInitialize)(this.picImageView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Controls.CtrImageViewer picImageView; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnPrev; + private System.Windows.Forms.Button btnSelectInExplorer; + } +} \ No newline at end of file diff --git a/ImageView/FrmImageView.cs b/ImageView/FrmImageView.cs new file mode 100644 index 0000000..fe17d21 --- /dev/null +++ b/ImageView/FrmImageView.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Windows.Forms; + +namespace ImageView +{ + public partial class FrmImageView : Form + { + private string _directoryPath = null; + private List _files = null; + private string _imagePath = null; + + private List files + { + get { + if (_files == null) + { + _files = Directory.GetFiles(_directoryPath).ToList(); + } + return _files; + } + } + + public FrmImageView(string imagePath) + { + InitializeComponent(); + _directoryPath = Path.GetDirectoryName(imagePath); + SetImage(imagePath); + } + + private bool SetImage(string imagePath) + { + _imagePath = imagePath; + Image image; + try + { + image = Bitmap.FromFile(_imagePath); + } + catch (Exception) { return false; } + picImageView.ImageShow = image; + Text = Path.GetFileName(_imagePath); + return true; + } + + private string NextFile(string filename) + { + int idx = files.IndexOf(filename); + idx++; + if (idx >= files.Count) + { + return null; + } + return files[idx]; + } + + private string PrevFile(string filename) + { + int idx = files.IndexOf(filename); + idx--; + if (idx < 0) + { + return null; + } + return files[idx]; + } + + private void NextImage() + { + string filename = _imagePath; + do + { + filename = NextFile(filename); + if (filename == null) { break; } + if (SetImage(filename)) { break; } + } while (true); + } + + private void PrevImage() + { + string filename = _imagePath; + do + { + filename = PrevFile(filename); + if (filename == null) { break; } + if (SetImage(filename)) { break; } + } while (true); + } + + private void btnNext_Click(object sender, EventArgs e) + { + NextImage(); + } + + private void btnPrev_Click(object sender, EventArgs e) + { + PrevImage(); + } + + private void btnSelectInExplorer_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("explorer.exe", string.Format("/select,\"{0}\"", _imagePath)); + } + } +} diff --git a/ImageView/FrmImageView.resx b/ImageView/FrmImageView.resx new file mode 100644 index 0000000..c77fdca --- /dev/null +++ b/ImageView/FrmImageView.resx @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8B9fX1au3t7eP39/f39vb29/b29vf29vb39vb29/b2 + 9vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/b2 + 9vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/b29vf29vb39vb29/f3 + 9/ft7e3e/Pz8VAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD09PR0y8vL8iQkJP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8wMDD/3Nzc8vz8/FQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADy8vLuFxcX/wMD + A/8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xER + Ef8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xER + Ef8RERH/ERER/xEREf8RERH/ERER/xEREf8BAQH/Ly8v/+3t7d0AAAAAAAAAAAAAAAAAAAAAAAAAAP// + /xPo6OjxAAAA/yoqKv/7+/v/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx + 8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx + 8f/x8fH/8fHx//Hx8f/x8fH/8fHx//Hx8f/x8fH/8fHx//z8/P8PDw//AQEB//f39/gAAAAAAAAAAAAA + AAAAAAAAAAAAAP///xrk5OTwAAAA/yoqKv/u7u7///////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////Pz8/8PDw//AAAA//j4 + +PgAAAAAAAAAAAAAAAAAAAAAAAAAAP///xrk5OTwAAAA/yoqKv/u7u7///////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////Pz + 8/8PDw//AAAA//j4+PgAAAAAAAAAAAAAAAAAAAAAAAAAAP///xrk5OTwAAAA/yoqKv/u7u7///////// + ///4+Pj/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d + 3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d//v7 + +/////////////Pz8/8PDw//AAAA//j4+PgAAAAAAAAAAAAAAAAAAAAAAAAAAP///xrk5OTwAAAA/yoq + Kv/u7u7////////////Kysr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+PgAAAAAAAAAAP///wX///8s////M/// + /0jk5OTwAAAA/yoqKv/x8fH////////////Kysr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj///8C8PDwh/T0 + 9PTT09PtycnJ7cnJye2kpKT1AAAA/x8fH//IyMj/zc3N/83Nzf+Pj4//AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj09PR0wMDA8w4ODv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/+Pj4/////////////Pz + 8/8PDw//AAAA//j4+Pjs7OzgISEh/wMDA/9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RE + RP9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RE + RP9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RERP9ERET/RERE/0RERP8MDAz/AAAA/+Pj + 4/////////////Pz8/8PDw//AAAA//j4+Pj39/f4AAAA/wsLC//7+/v/7e3t/+3t7f/t7e3/7e3t/+3t + 7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t + 7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t//f3 + 9/8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsL + C//09PT///////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj4+Pj4AAAA/wsLC//09PT////////////4+Pj/u7u7/7u7u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7 + u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7 + u/+7u7v/u7u7/7u7u/+7u7v/u7u7//Dw8P///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz + 8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj + 4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t + 7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////// + ///m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bG + xv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsL + C//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz + 8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj + 4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t + 7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////// + ///m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/zc3N/9LS0v/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/8bG + xv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsL + C//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/OTk5//Hx8f/x8fH/2NjY/0tLS/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj4+Pj4AAAA/wsLC//09PT////////////m5ub/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8zMzP/8PDw//////////////////Dw8P/e3t7/VVVV/wEB + Af8AAAD/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz + 8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////t7e3/CQkJ/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/zk5Of/x8fH///////////////////////// + ////////8fHx/9jY2P9LS0v/AAAA/wAAAP8AAAD/AAAA/8bGxv///////////+3t7f8uLi7/AAAA/+Pj + 4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT////////////29vb/5OTk/zo6 + Ov8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/OTk5//Hx8f////////////// + ///////////////////////////////////x8fH/2tra/0tLS/8AAAD/AAAA/8bGxv///////////+3t + 7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////// + //////////////Ly8v+hoaH/CwsL/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8zMzP/8PDw//// + //////////////////////////////////////////////////////////////Dw8P/e3t7/VVVV/8bG + xv///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsL + C//09PT////////////////////////////19fX/5OTk/zo6Ov8AAAD/AAAA/wAAAP8AAAD/AAAA/zg4 + OP/x8fH///////////////////////////////////////////////////////////////////////// + ////////8fHx//39/f///////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj4+Pj4AAAA/wsLC//09PT///////////////////////////////////////Pz8/+VlZX/CQkJ/wAA + AP8AAAD/ODg4//Dw8P////////////////////////////////////////////////////////////// + /////////////////////////////////////////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz + 8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////////////////////////////////////// + ///19fX/5OTk/zo6Ov84ODj/8fHx///////////////////////////////////////x8fH/9vb2/+3t + 7f/09PT/+fn5/////////////////////////////////////////////////+3t7f8uLi7/AAAA/+Pj + 4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////////////////////// + //////////////////////////////Ly8v/z8/P///////////////////////////////////////Ly + 8v9hYWH/BQUF/wAAAP8YGBj/qqqq//Ly8v///////////////////////////////////////////+3t + 7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsLC//09PT///////// + //////////////////////////////////////////////////////////////////////////////// + ////////8fHx/1JSUv8AAAD/AAAA/wAAAP8AAAD/AQEB/7y8vP/8/Pz///////////////////////// + /////////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4+Pj4+Pj4AAAA/wsL + C//09PT///////////////////////////////////////////////////////////////////////// + ////////////////////////5+fn/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/zo6Ov/u7u7///////// + /////////////////////////////+3t7f8uLi7/AAAA/+Pj4/////////////Pz8/8PDw//AAAA//j4 + +Pj4+Pj4AAAA/wsLC//09PT///////////////////////////////////////////////////////// + ////////////////////////////////////////y8vL/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/xgY + GP/x8fH//////////////////////////////////////+3t7f8uLi7/AAAA/97e3v/v7+//7e3t//r6 + +v8PDw//AAAA//f39/j4+Pj4AAAA/wsLC//09PT///////////////////////////////////////// + ////////////////////////////////////////////////////////6urq/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/z09Pf/u7u7//////////////////////////////////////+3t7f8uLi7/AAAA/yoq + Kv8zMzP/MzMz/zMzM/8DAwP/ICAg/+3t7eL4+Pj4AAAA/wsLC//09PT///////////////////////// + ////////////////////////////////////////////////////////////////////////8fHx/1tb + W/8AAAD/AAAA/wAAAP8AAAD/AQEB/8TExP/9/f3//////////////////////////////////////+3t + 7f8uLi7/AAAA/wAAAP8AAAD/AAAA/wAAAP8QEBD/wcHB8/T09HT4+Pj4AAAA/wsLC//09PT///////// + //////////////////////////////////////////////////////////////////////////////// + //////////////Ly8v9vb2//CwsL/wAAAP8jIyP/t7e3//Pz8/////////////////////////////// + /////////////+3t7f8uLi7/AAAA/7CwsPXb29vu29vb7t7e3u7y8vLz8fHxhP///wL4+Pj4AAAA/wsL + C//09PT///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////y8vL/9fX1//f39//x8fH/+vr6//////////////////// + /////////////////////////////+3t7f8uLi7/AAAA/+Hh4e////88////Iv///x////8BAAAAAAAA + AAD4+Pj4AAAA/wsLC//09PT///////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////+3t7f8uLi7/AAAA/+Hh4e////8eAAAAAAAA + AAAAAAAAAAAAAAAAAAD4+Pj4AAAA/wsLC//09PT///////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////+3t7f8uLi7/AAAA/+Hh + 4e////8eAAAAAAAAAAAAAAAAAAAAAAAAAAD4+Pj4AAAA/wsLC//09PT///////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////+3t + 7f8uLi7/AAAA/+Hh4e////8eAAAAAAAAAAAAAAAAAAAAAAAAAAD4+Pj4AAAA/wsLC//09PT///////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////+3t7f8uLi7/AAAA/+Hh4e////8eAAAAAAAAAAAAAAAAAAAAAAAAAAD39/f3AgIC/wsL + C//+/v7/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f3 + 9//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f3 + 9//39/f/9/f3//f39//39/f/9/f3//39/f8uLi7/AAAA/+bm5vD///8XAAAAAAAAAAAAAAAAAAAAAAAA + AADs7OzZNDQ0/wEBAf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xER + Ef8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xER + Ef8RERH/ERER/xEREf8RERH/ERER/xEREf8RERH/ERER/xEREf8DAwP/FhYW//Ly8vAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAD8/PxO4ODg8jQ0NP8CAgL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8nJyf/zMzM8vT0 + 9HQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/Pz8Tuzs7Nn7+/v8//////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////z8 + /P3q6urc+Pj4ZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAAAAEAAPwAAAAAAAAA/AAAAAAA + AAD4AAAAAAAAAPgAAAAAAAAA+AAAAAAAAAD4AAAAAAAAAPgAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAA + AAAAHwAAAAAAAAAfAAAAAAAAAB8AAAAAAAAAHwAAAAAAAAAfAAAAAAAAAD8AAAAAAAAAPwAAgAAAAAB/ + AAA= + + + \ No newline at end of file diff --git a/ImageView/ImageView.csproj b/ImageView/ImageView.csproj new file mode 100644 index 0000000..cca3d70 --- /dev/null +++ b/ImageView/ImageView.csproj @@ -0,0 +1,93 @@ + + + + + Debug + AnyCPU + {B1B8280E-A303-4E09-892D-382A6AB206E3} + WinExe + Properties + ImageView + ImageView + v3.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + icon_images.ico + + + + + + + + + + + + + + + Component + + + Form + + + FrmImageView.cs + + + + + FrmImageView.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/ImageView/Program.cs b/ImageView/Program.cs new file mode 100644 index 0000000..7da6c31 --- /dev/null +++ b/ImageView/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Windows.Forms; + +namespace ImageView +{ + static class Program + { + [STAThread] + static void Main(string[] args) + { + if (args.Length < 1) + { + MessageBox.Show("Image Path missing"); + return; + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FrmImageView(args[0])); + } + } +} diff --git a/ImageView/Properties/AssemblyInfo.cs b/ImageView/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ba6e273 --- /dev/null +++ b/ImageView/Properties/AssemblyInfo.cs @@ -0,0 +1,14 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ImageView")] +[assembly: AssemblyDescription("Simple image viewer")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ImageView")] +[assembly: AssemblyCopyright("Copyright © Valeriano A.R. 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: Guid("b1b8280e-a303-4e09-892d-382a6ab206e3")] +[assembly: AssemblyVersion("1.0.*")] \ No newline at end of file diff --git a/ImageView/Properties/Resources.Designer.cs b/ImageView/Properties/Resources.Designer.cs new file mode 100644 index 0000000..f16d6e7 --- /dev/null +++ b/ImageView/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ImageView.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ImageView.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ImageView/Properties/Resources.resx b/ImageView/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ImageView/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ImageView/Properties/Settings.Designer.cs b/ImageView/Properties/Settings.Designer.cs new file mode 100644 index 0000000..2478b40 --- /dev/null +++ b/ImageView/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ImageView.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/ImageView/Properties/Settings.settings b/ImageView/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/ImageView/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ImageView/icon_images.ico b/ImageView/icon_images.ico new file mode 100644 index 0000000..cd72b24 Binary files /dev/null and b/ImageView/icon_images.ico differ diff --git a/ImageView/icon_images.png b/ImageView/icon_images.png new file mode 100644 index 0000000..ba3e575 Binary files /dev/null and b/ImageView/icon_images.png differ diff --git a/ImageView/icon_images.svg b/ImageView/icon_images.svg new file mode 100644 index 0000000..1e06cfe --- /dev/null +++ b/ImageView/icon_images.svg @@ -0,0 +1,69 @@ + + + +image/svg+xml \ No newline at end of file