/Platters/extensibility/IImageFormat.cs

http://skimpt.googlecode.com/ · C# · 92 lines · 27 code · 20 blank · 45 comment · 0 complexity · 4beb3b49d53f87d41d440a252aff9acf MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Forms;
  4. using System.Drawing;
  5. using System.Drawing.Imaging;
  6. using System.Globalization;
  7. using System.IO;
  8. public delegate void ImageCapturedEventHandler(object sender, ImageEventArgs e);
  9. public delegate void StreamHandler(Stream stream, Image image);
  10. public delegate void ImageCaptureInitializedEventHandler(object sender, EventArgs e);
  11. public delegate void ImageCapturingEventHandler(object sender, ImageEventArgs e);
  12. /// <summary>
  13. /// All new imageformats implement this interface to expose the methods
  14. /// </summary>
  15. public interface IImageFormat
  16. {
  17. /// <summary>
  18. /// This gets the "class" name through reflection
  19. /// to give us the format.
  20. /// EX: public class PNG : IImageFormat
  21. /// Return: PNG
  22. /// </summary>
  23. IImageFormat Format { get; }
  24. /// <summary>
  25. /// Connects the specified persistable output.
  26. /// </summary>
  27. /// <param name="persistableOutput">The persistable output.</param>
  28. void Connect(IImageOutput persistableOutput);
  29. /// <summary>
  30. /// Disconnects this instance.
  31. /// </summary>
  32. void Disconnect();
  33. /// <summary>
  34. /// Gets the extension.
  35. /// </summary>
  36. /// <value>The extension.</value>
  37. string Extension { get; }
  38. /// <summary>
  39. /// Gets the description.
  40. /// </summary>
  41. /// <value>The description.</value>
  42. string Description { get; }
  43. /// <summary>
  44. /// Gets the menu.
  45. /// </summary>
  46. /// <value>The menu.</value>
  47. MenuItem Menu { get; }
  48. void SaveImage(ImageEventArgs e);
  49. }
  50. public interface IImageOutput
  51. {
  52. /// <summary>
  53. /// Occurs once a screen capture is complete.
  54. /// </summary>
  55. /// <remarks>
  56. /// <para>
  57. /// The full size image capture is available at this point as well
  58. /// as the thumbnail if enabled.</para>
  59. /// <para>
  60. /// Information about the capture as well as the images is available via the
  61. /// <see cref="ImageEventArgs"/> object.</para>
  62. /// </remarks>
  63. event ImageCapturedEventHandler ImageCaptured;
  64. /// <summary>
  65. /// Occurs when a plug-in is loaded but before any screen captures take place.
  66. /// </summary>
  67. event ImageCaptureInitializedEventHandler ImageCaptureInitialized;
  68. /// <summary>
  69. /// Occurs when a screen capture has started but before the image is available.
  70. /// </summary>
  71. event ImageCapturingEventHandler ImageCapturing;
  72. }