/// <summary> /// This connects the Jpeg class to the output class defined by Skimpt. /// How it works: /// The skimptImage class defined by Skimpt implments the IImageOuput interface. Therefore /// it must provide an event handler for the event ImageCaptured and as such it is /// defined in our SkimptImage class. But you have to realize that the imagecaptured means that /// we have captured the image into memory but is not yet saved. Therefore /// we pass our JPGFormat class a reference of our SkimptImage class. /// We then create an event handler for ImageCaptured in JpgFormat so we can /// save it as Jpeg. Note that the SkimptImage upon capturing the image /// will raise this event and so like I said previously the event is defined /// in the SkimptImage class but the event handler will be defined in this class /// because it already has a reference to the SkimptImage class. /// </summary> /// <param name="persistableOutput"> /// This parameter is a class defined by skimpt that implements the IImageOutput interface /// </param> public void Connect(IImageOutput persistableOutput) { if (persistableOutput == null) throw new ArgumentNullException("persistable output"); output = persistableOutput; output.ImageCaptured += new ImageCapturedEventHandler(output_ImageCaptured); }
/// <summary> /// This connects the Jpeg class to the output class defined by Skimpt. /// How it works: /// The skimptImage class defined by Skimpt implments the IImageOuput interface. Therefore /// it must provide an event handler for the event ImageCaptured and as such it is /// defined in our SkimptImage class. But you have to realize that the imagecaptured means that /// we have captured the image into memory but is not yet saved. Therefore /// we pass our JPGFormat class a reference of our SkimptImage class. /// We then create an event handler for ImageCaptured in JpgFormat so we can /// save it as Jpeg. Note that the SkimptImage upon capturing the image /// will raise this event and so like I said previously the event is defined /// in the SkimptImage class but the event handler will be defined in this class /// because it already has a reference to the SkimptImage class. /// </summary> /// <param name="persistableOutput"> /// This parameter is a class defined by skimpt that implements the IImageOutput interface /// </param> public void Connect(IImageOutput persistableOutput) { if (persistableOutput == null) { throw new ArgumentNullException("persistable output"); } output = persistableOutput; output.ImageCaptured += new ImageCapturedEventHandler(output_ImageCaptured); }