Write
for the Image Viewer in Windows C#.NET
Nagpur University MCA V Semester, C#.Net, Embedded System Programming, Nagpur University Practical MCA V SEM
According to Wiki "An image viewer or image browser is a computer program that can display stored graphical image; it can often handle various graphics file formats. Such software usually renders the image according to properties of the display such as color depth, display resolution, and color profile.
Although you may use a full-featured bitmap graphics editor (such as Photoshop or the GIMP) as an image viewer, these have many editing functionalities which are not needed for just viewing images, and therefore usually start rather slowly. Also, most viewers have functionalities that editors usually lack, such as stepping through all the images in a directory (possibly as a slideshow).
Image viewers give maximal flexibility to the user by providing a direct view of the directory structure available on a hard disk. Most image viewers do not provide any kind of automatic organization of pictures and therefore the burden remains on the user to create and maintain their folder structure (using tag- or folder-based methods). However, some image viewers also have features for organizing images, especially an image database, and hence can also be used as image organizers."
using System;
using
System.Linq;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
using System.Drawing.Imaging;
using
System.Reflection;
using System.IO;
namespace
imageviewer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object
sender, EventArgs e)
{
}
private void button1_Click(object
sender, EventArgs e)
{
int ht =
Convert.ToInt32(textBox1.Text);
int wd =
Convert.ToInt32(textBox2.Text);
pictureBox1.Height = ht;
pictureBox1.Width = wd;
}
private void
comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox1.Text =
"bluehil";
if (comboBox2.Text ==
"bluehil")
{
System.Reflection.Assembly myAssembly
= System.Reflection.Assembly.GetExecutingAssembly();
Stream myStream =
myAssembly.GetManifestResourceStream("imageviewer.Bluehills.jpg");
Bitmap image = new
Bitmap(myStream);
this.ClientSize = new Size(image.Width, image.Height);
pictureBox1.Image = image;
}
if (comboBox2.Text ==
"sunset")
{
System.Reflection.Assembly
myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Stream myStream =
myAssembly.GetManifestResourceStream("imageviewer.Sunset.jpg");
Bitmap image = new
Bitmap(myStream);
this.ClientSize = new
Size(image.Width, image.Height);
pictureBox1.Image = image;
}
if (comboBox2.Text ==
"water")
{
System.Reflection.Assembly
myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Stream myStream =
myAssembly.GetManifestResourceStream("imageviewer.Waterlilies.jpg");
Bitmap image = new
Bitmap(myStream);
this.ClientSize = new
Size(image.Width, image.Height);
pictureBox1.Image = image;
}
if (comboBox2.Text ==
"winter")
{
System.Reflection.Assembly
myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Stream myStream =
myAssembly.GetManifestResourceStream("imageviewer.Winter.jpg");
Bitmap image = new
Bitmap(myStream);
this.ClientSize = new
Size(image.Width, image.Height);
pictureBox1.Image = image;
}
}
private void Form1_Load(object sender,
EventArgs e)
{
}
}
}
Write
for the Image Viewer in Windows C#.NET
Nagpur University MCA V Semester, C#.Net, Embedded System Programming, Nagpur University Practical MCA V SEM
OUT PUT
Write
for the Image Viewer in Windows C#.NET
Nagpur University MCA V Semester, C#.Net, Embedded System Programming, Nagpur University Practical MCA V SEM