예제 #1
0
 public static void CollectImages(Email email)
 {
     foreach (Attachment attachment in email.Attachments)
     {
         Picture picture = new Picture();
         picture.Name = attachment.Name;
         picture.ImageData = Image.FromStream(attachment.Stream);
         OnPictureCollected(new PictureCollectedEventArgs() { picture = picture});
     }
 }
예제 #2
0
 public bool SavePicture(Picture image)
 {
     bool Success = true;
     try
     {
         image.ImageData.Save(TargetFolder + "\\" + image.Name, ImageFormat.Jpeg);
     }
     catch
     {
         Success = false;
     }
     return Success;
 }
예제 #3
0
 static void PictureCollector_PictureCollected(PictureCollectedEventArgs e)
 {
     Image resized = PictureManipulator.ResizeTo800x600(e.picture.ImageData);
     Picture pict = new Picture() { ImageData = resized, Name = e.picture.Name };
     saver.SavePicture(pict);
 }