LISTING PROGRAM
1.
Form Home
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace KhalidaZia121401018 {
/// <summary>
/// Description of MainForm. /// </summary>
public partial class MainForm : Form {
public MainForm() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
// }
void ImplementationToolStripMenuItemClick(object sender, EventAr gs e)
{
FormImplementation fi = new FormImplementation(); fi.ShowDialog();
}
void HelpToolStripMenuItemClick(object sender, EventArgs e) {
FormHelp fh = new FormHelp(); fh.ShowDialog();
}
void AboutToolStripMenuItemClick(object sender, EventArgs e) {
FormAbout fa = new FormAbout(); fa.ShowDialog();
} }
2.
Form Implementation
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace KhalidaZia121401018 {
/// <summary>
/// Description of FormImplementation. /// </summary>
public partial class FormImplementation : Form {
public FormImplementation() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
// }
void GroupBox2Enter(object sender, EventArgs e) {
}
void Button1Click(object sender, EventArgs e) {
try
{
{ 350 px and max 500 x 500 px", "Warning");
{
= new Rectangle(bitmap.Width / 4, bitmap.Height / 4, 200, 100); Bitmap cropped = bitmap.Clone(rect, bitmap.PixelFormat);
= new Rectangle(bitmap.Width / 4, bitmap.Height / 4, 250, 150);
GH.DrawImage(citra2, citra1.Width / 4, citra1.Height / 4);
pictureBox5.Image = Gabung(PB2, PB8); ght >= 350 && bit.Width >= 350 )
{ 350 px and max 500 x 500 px", "Warning");
{
SaveFileDialog save = new SaveFileDialog(); save.Filter = "image Files| *.bmp";
save.FileName = "*.bmp";
if (save.ShowDialog() == DialogResult.OK) {
pictureBox7.Image.Save(save.FileName, System.Draw ing.Imaging.ImageFormat.Bmp);
MessageBox.Show("Image has
saved", "save", MessageBoxButtons.OK, MessageBoxIcon.Information); }
else
{
MessageBox.Show("Image doesn't save "); }
} }
void Button9Click(object sender, EventArgs e) {
if(pictureBox5.Image != null) {
SaveFileDialog save = new SaveFileDialog(); save.Filter = "image Files| *.bmp";
save.FileName = "*.bmp";
if (save.ShowDialog() == DialogResult.OK) {
pictureBox5.Image.Save(save.FileName, System.Draw ing.Imaging.ImageFormat.Bmp);
MessageBox.Show("Image has
saved", "save", MessageBoxButtons.OK, MessageBoxIcon.Information); }
else
{
MessageBox.Show("Image doesn't save "); }
} }
} }
3.
Form Help
using System;
using System.Drawing;
namespace KhalidaZia121401018 {
/// <summary>
/// Description of FormHelp. /// </summary>
public partial class FormHelp : Form {
public FormHelp() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
// }
void FormHelpLoad(object sender, EventArgs e) {
richTextBox1.Enabled = false; }
} }
4.
Form About
using System;
using System.Drawing;
using System.Windows.Forms;
namespace KhalidaZia121401018 {
/// <summary>
/// Description of FormAbout. /// </summary>
public partial class FormAbout : Form {
public FormAbout() {
//
Forms designer support. //
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.