Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
juangallostra authored May 27, 2017
1 parent 40202d1 commit 5fd3c9e
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 47 deletions.
66 changes: 51 additions & 15 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,26 @@ private void button2_Click_1(object sender, EventArgs e)
{
Imagen_BW = (Image)HelperMethods.Grayscale(ResizedImage_O); // Get grayscale image
}
ResultImage = HelperMethods.Convert2ASCII(Imagen_BW, CharSet,out ResultText);
// Test if there are Width and Height values on the pixel per character textboxes
int? width = null;
int? height = null;
if (PixelsToCharacterWidth.Text != "" & PixelsToCharacterHeight.Text != "")
{
// Convert them to integers
try
{
width = Int32.Parse(PixelsToCharacterWidth.Text);
height = Int32.Parse(PixelsToCharacterHeight.Text);
}
catch (Exception)
{

throw new System.FormatException("Width and Height values must be integers");
}

}

ResultImage = HelperMethods.Convert2ASCII(Imagen_BW, width, height, CharSet,out ResultText);
ImageText = ResultText;
if (IsBlackAndWhite.Checked)
pictureBox2.Image = HelperMethods.ResizeImage(ResultImage, pictureBox2);
Expand Down Expand Up @@ -136,8 +155,6 @@ private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
ResizedImage_O = null;
Imagen_BW = null;
ResultImage = null;


}

private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
Expand All @@ -146,7 +163,5 @@ private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
}




}
}
Loading

0 comments on commit 5fd3c9e

Please sign in to comment.