Using system;
Using system. Collections. Generic;
Using system. componentmodel;
Using system. Data;
Using system. drawing;
Using system. text;
Using system. Windows. forms;
Namespace Image Format Conversion Tool
{
Public partial class form1: Form
{
Public form1 ()
{
Initializecomponent ();
}
Private void form1_load (Object sender, eventargs E)
{
This. skinengine1.skinfile = "midsummercolor2.ssk ";
}
String url = string. empty;
Private void btnopen_click (Object sender, eventargs E)
{
This. picturebox1.visible = true;
This. openfiledialog1.showdialog ();
Url = This. openfiledialog1.filename;
If (URL! = "")
{
Picturebox1.image = image. fromfile (URL );
}
}
Private void btnsave_click (Object sender, eventargs E)
{
If (url = "")
{
MessageBox. Show ("select the image to be converted! "," Prompt ", messageboxbuttons. OK, messageboxicon. Warning );
}
Else
{
This. savefiledialog1.showdialog ();
If (this. rbtnbmp. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". BMP ",
System. Drawing. imaging. imageformat. BMP );
}
If (this. rbtngif. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". GIF ",
System. Drawing. imaging. imageformat. GIF );
}
If (this. rbtnjpg. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". jpg ",
System. Drawing. imaging. imageformat. JPEG );
}
If (this. rbtnpng. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". PNG ",
System. Drawing. imaging. imageformat. PNG );
}
If (this. rbtnicon. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". Icon ",
System. Drawing. imaging. imageformat. Icon );
}
If (this. rbtnwmf. Checked = true)
{
This. picturebox1.image. Save (this. savefiledialog1.filename + ". WMF ",
System. Drawing. imaging. imageformat. WMF );
}
}
}
Private void policyicon#mousedoubleclick (Object sender, mouseeventargs E)
{
If (this. windowstate = formwindowstate. Minimized)
{
This. windowstate = formwindowstate. normal;
This. Activate ();
}
}
Private void form=formclosing (Object sender, formclosingeventargs E)
{
Application. Exit ();
}
}
}