- class ExampleOfLegalsoft
- {
-
-
-
-
-
-
-
-
-
-
- public void SmallPic(string strOldPic, string strNewPic, int intWidth, int intHeight)
- {
- System.Drawing.Bitmap objPic, objNewPic;
- try
- {
- objPic = new System.Drawing.Bitmap(strOldPic);
- objNewPic = new System.Drawing.Bitmap(objPic, intWidth, intHeight);
- objNewPic.Save(strNewPic);
- }
- catch (Exception exp) { throw exp; }
- finally
- {
- objPic = null;
- objNewPic = null;
- }
- }
-
-
-
-
-
-
- public void SmallPic(string strOldPic, string strNewPic, int intWidth)
- {
- System.Drawing.Bitmap objPic, objNewPic;
- try
- {
- objPic = new System.Drawing.Bitmap(strOldPic);
- int intHeight = (intWidth / objPic.Width) * objPic.Height;
- objNewPic = new System.Drawing.Bitmap(objPic, intWidth, intHeight);
- objNewPic.Save(strNewPic);
- }
- catch (Exception exp) { throw exp; }
- finally
- {
- objPic = null;
- objNewPic = null;
- }
- }
-
-
-
-
-
-
- public void SmallPic(string strOldPic, string strNewPic, int intHeight)
- {
- System.Drawing.Bitmap objPic, objNewPic;
- try
- {
- objPic = new System.Drawing.Bitmap(strOldPic);
- int intWidth = (intHeight / objPic.Height) * objPic.Width;
- objNewPic = new System.Drawing.Bitmap(objPic, intWidth, intHeight);
- objNewPic.Save(strNewPic);
- }
- catch (Exception exp) { throw exp; }
- finally
- {
- objPic = null;
- objNewPic = null;
- }
- }
- }
|