Aplikasi Image Resize

Aplikasi Image Resize

Nama : Ahmad Farhan Zuhdi
NIM : 13141008
Kelas : 13.6A.37 (BSI PEMUDA)
Tugas Network Programming II

 Gambar 4.1. Tampilan Image Resize

Gambar 4.2. Choose Picture

 Gambar 4.3.Choose Directories Save


 Gambar 4.4. Type Picture

Gambar 4.5. Image was Resize

Gambar 4.6. Image has been Saved



Coding Project :

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

namespace Image_Resize
{
    public partial class Form1 : Form
    {
        Image img;
        string[] extend = { ".PNG", ".JPEG", ".JPG", ".GIF"};

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < extend.Length; i++)
                comboBox.Items.Add(extend[i]);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "images | *.png;*.jpg;*.jpeg;*.gif";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                txtch.Text = ofd.FileName;
                img = Image.FromFile(ofd.FileName);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            if (fbd.ShowDialog() == DialogResult.OK)
                txtsv.Text = fbd.SelectedPath;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int w = Convert.ToInt32(txtw.Text), h = Convert.ToInt32(txth.Text);
            img = Resize(img, w, h);
            ((Button)sender).Enabled = false;
            MessageBox.Show("Image resized");
        }

        Image Resize(Image image, int w, int h)
        {
            Bitmap bmp = new Bitmap(w, h);
            Graphics graphic = Graphics.FromImage(bmp);
            graphic.DrawImage(image, 0, 0, w, h);
            graphic.Dispose();

            return bmp;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int dot = 0, slash = 0;
            for (int j = txtch.Text.Length - 1; j >= 0; j--)
                if(txtch.Text[j] == '.')
                    dot = j;
                else if (txtch.Text[j] == '\\')
                {
                    slash = j;
                    break;
                }

            img.Save(txtsv.Text + "\\" + txtch.Text.Substring(slash + 1, dot - slash - 1) + extend[comboBox.SelectedIndex]);
            ((Button)sender).Enabled = false;
            MessageBox.Show("Image Saved");
        }
    }
}
Share:

Aplikasi Notepad

Aplikasi Notepad


Nama : Ahmad Farhan Zuhdi
NIM : 13141008
Kelas : 13.6A.37 (BSI PEMUDA)
Tugas Network Programming II




 Gambar 3.1. Tampilan Display Notepad
 

 Gambar 3.2. Tampilan Menu "File" pada Notepad


  
Gambar 3.3. Tampilan Menu "Edit" pada Notepad


 Gambar 3.4. Tampilan Menu "Format" pada Notepad

 Gambar 3.5. Tampilan Menu "Format - Font" pada Notepad

 Gambar 3.6. Tampilan Menu "Format" pada Notepad (2)


 Gambar 3.7. Tampilan Menu "Format - Color" pada Notepad


 Gambar 3.8. Tampilan Menu "Help - About" pada Notepad


 Coding Project :

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

namespace Notepad
{
    public partial class Form1 : Form
    {
        string path;

        public Form1()
        {
            InitializeComponent();
        }

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            path = string.Empty;
            richTextBox.Clear();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == DialogResult.OK) richTextBox.LoadFile(ofd.FileName, RichTextBoxStreamType.PlainText);
            this.Text = ofd.FileName;
        }

        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "Text Document(*.txt)|*.txt|All Files(*.*)|*.*";
            if (sfd.ShowDialog() == DialogResult.OK) richTextBox.SaveFile(sfd.FileName, RichTextBoxStreamType.PlainText);
            this.Text = sfd.FileName;

        }

        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog safd = new SaveFileDialog();
            safd.Filter = "Text Document(*.txt)|*.txt|All Files(*.*)|*.*";
            if (safd.ShowDialog() == DialogResult.OK) richTextBox.SaveFile(safd.FileName, RichTextBoxStreamType.PlainText);
            this.Text = safd.FileName;
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (frmAbout frm = new frmAbout())
            {
                frm.ShowDialog();
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void cutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.Cut();
        }

        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.Copy();
        }

        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.Paste();
        }

        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.Undo();
        }

        private void redoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.Redo();
        }

        private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox.SelectAll();
        }

        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FontDialog fd = new FontDialog();
            if (fd.ShowDialog() == DialogResult.OK) richTextBox.Font = fd.Font;
        }

        private void colorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorDialog cd = new ColorDialog();
            if (cd.ShowDialog() == DialogResult.OK) richTextBox.ForeColor = cd.Color;
        }
    }
}
Share:

Aplikasi Billing

Aplikasi Billing


Nama : Ahmad Farhan Zuhdi
NIM : 13141008
Kelas : 13.6A.37 (BSI PEMUDA)
Tugas Network Programming II



 Gambar 2.1. Tampilan Billing

Gambar 2.2. Tampilan Login Billing

Gambar 2.3. Tampilan Display Billing

Coding Project :

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;
using System.Diagnostics;

namespace Billing_Warnet
{
    public partial class Form1 : Form
    {
        private Stopwatch wkt = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text != "")
            {
                wkt = new Stopwatch();
                if(button1.Text == "Login")
                {
                    wkt.Start();
                    if(radioButton1.Checked)
                    {
                        label3.Text = "Biasa";
                    }
                    else if(radioButton2.Checked)
                    {
                        label3.Text = "2 Jam";
                    }
                    else if(radioButton3.Checked)
                    {
                        label3.Text = "3 Jam";
                    }
                    else if(radioButton4.Checked)
                    {
                        label3.Text = "4 Jam";
                    }
                    else if(radioButton5.Checked)
                    {
                        label3.Text = "8 Jam";
                    }

                    label3.Visible = true;
                    wkt.Start();
                    button1.Text = "STOP";
                    label5.Visible = true;
                    button1.Text = "STOP";
                    radioButton1.Enabled=false;
                    radioButton2.Enabled=false;
                    radioButton3.Enabled=false;
                    radioButton4.Enabled=false;
                    radioButton5.Enabled=false;
                }
                else if(button1.Text=="STOP")
                {
                    wkt.Stop();
                    if(radioButton1.Checked)
                    {
                        if(wkt.Elapsed.TotalMinutes <= 30.00)
                        {
                            MessageBox.Show("Jumlah Bayar Rp.2000","Total Bayar");

                        }
                        else if(wkt.Elapsed.TotalHours <= 1.00)
                        {
                            MessageBox.Show("Jumlah Bayar Rp.3000","Total Bayar");
                        }
                        else if(wkt.Elapsed.TotalHours <= 2.00)
                        {
                            MessageBox.Show("Jumlah Bayar Rp.6000","Total Bayar");
                        }
                    }
                    if(radioButton2.Checked)
                    {
                        MessageBox.Show("Jumlah Bayar Rp.5000","Total Bayar Paket 2");
                    }
                    if(radioButton3.Checked)
                    {
                        MessageBox.Show("Jumlah Bayar Rp.8000","Total Bayar Paket 3");
                    }
                    if(radioButton4.Checked)
                    {
                        MessageBox.Show("Jumlah Bayar Rp.10000","Total Bayar Paket 4");
                    }
                    if (radioButton5.Checked)
                    {
                        MessageBox.Show("Jumlah Bayar Rp.15000", "Total Bayar Paket Malam");
                    }

                    wkt.Reset();
                    label3.Visible=false;
                    button1.Text="Login";
                    textBox1.Text=null;
                    label5.Visible=false;
                    button1.Text="Login";
                    radioButton1.Enabled=true;
                    radioButton2.Enabled = true;
                    radioButton3.Enabled = true;
                    radioButton4.Enabled = true;
                    radioButton5.Enabled = true;

                }
            }

            else if (textBox1.Text == "")
            {
                MessageBox.Show("Nama Harus Diisi !", "Important Message");
            }
       
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (wkt != null)
            {
                label5.Text = wkt.Elapsed.ToString(@"hh\:mm\:ss");
            }
                if (radioButton2.Checked)
                {
                    if (label5.Text == "02:00:00")
                    {
                        wkt.Reset();
                        label3.Visible = false;
                        button1.Text = "Log In";
                        textBox1.Text = null;
                        label5.Visible = false;
                        button1.Text = "Log In";
                        MessageBox.Show("Jumlah Bayar Rp. 5000", "Total Bayar Paket 2");
                        radioButton1.Enabled = true;
                        radioButton2.Enabled = true;
                        radioButton3.Enabled = true;
                        radioButton4.Enabled = true;
                        radioButton5.Enabled = true;
                    }
                }

                if (radioButton3.Checked)
                {
                    if (label5.Text == "03:00:00")
                    {
                        wkt.Reset();
                        label3.Visible = false;
                        button1.Text = "Log In";
                        textBox1.Text = null;
                        label5.Visible = false;
                        button1.Text = "Log In";
                        MessageBox.Show("Jumlah Bayar Rp.8000", "Total Bayar Paket 3");
                        radioButton1.Enabled = true;
                        radioButton2.Enabled = true;
                        radioButton3.Enabled = true;
                        radioButton4.Enabled = true;
                        radioButton5.Enabled = true;
                    }
                }

                if (radioButton4.Checked)
                {
                    if (label5.Text == "04:00:00")
                    {
                        wkt.Reset();
                        label3.Visible = false;
                        button1.Text = "Log In";
                        textBox1.Text = null;
                        label5.Visible = false;
                        button1.Text = "Log In";
                        MessageBox.Show("Jumlah Bayar Rp.10000", "Total Bayar Paket 4");
                        radioButton1.Enabled = true;
                        radioButton2.Enabled = true;
                        radioButton3.Enabled = true;
                        radioButton4.Enabled = true;
                        radioButton5.Enabled = true;
                    }
                }

                if (radioButton5.Checked)
                {
                    if (label5.Text == "08:00:00")
                    {
                        wkt.Reset();
                        label3.Visible = false;
                        button1.Text = "Log In";
                        textBox1.Text = null;
                        label5.Visible = false;
                        button1.Text = "Log In";
                        MessageBox.Show("Jumlah Bayar Rp.15000", "Total Bayar Paket Malam");
                        radioButton1.Enabled = true;
                        radioButton2.Enabled = true;
                        radioButton3.Enabled = true;
                        radioButton4.Enabled = true;
                        radioButton5.Enabled = true;
                    }
                }
        }
    }
}

Share:

Aplikasi Stopwatch



Cara Membuat Stopwatch dengan Visual Studio C# 2010

Nama : Ahmad Farhan Zuhdi
NIM : 13141008
Kelas : 13.6A.37 (BSI PEMUDA)
Tugas Network Programming II



 Gambar 1.1. Display Stopwatch

Gambar 1.2. Tampilan START Stopwatch

 Gambar 1.3. Tampilan STOP  Stopwatch

Gambar 1.4. Tampilan RESET  Stopwatch

Coding Project :

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 stopwatchh
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int hour, min, sec, ms = 0;

        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Stop();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = hour + ":" + min + ":" + sec + ":" + ms.ToString();
            ms++;
            if (ms > 10)
            {
                sec++;
                ms = 0;
            }
            else
            {
                ms++;
            }
            if (min > 60)
            {
                hour++;
                min = 0;
            }

        }

        private void button3_Click(object sender, EventArgs e)
        {
            hour = 0;
            min = 0;
            sec = 0;
            ms = 0;
            label1.Text = 0 + ":" + 0 + ":" + 0 + ":" + 0;
        }

    }
}
Share:

Cari Blog Ini

websiteku19.blogspot.co.id

Diberdayakan oleh Blogger.

Aplikasi Image Resize

Aplikasi Image Resize Nama : Ahmad Farhan Zuhdi NIM : 13141008 Kelas : 13.6A.37 (BSI PEMUDA) Tugas Network Programming II  Gambar...