private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e) { if (this._isRecording) { //Initialize values; _previousHash = string.Empty; _previousTimestamp = DateTime.MinValue; _fileName = e.ImageNames.FullSize; this._AnimatedGifEncoder = new AnimatedGifEncoder(); this._AnimatedGifEncoder.Start(e.ImageNames.FullSize); this._AnimatedGifEncoder.SetDelay(PluginSettings.CaptureInterval); this._AnimatedGifEncoder.SetQuality(PluginSettings.EncodingQuality); this._AnimatedGifEncoder.SetRepeat(PluginSettings.Repeats); this._recordTimer.Start(); if (PluginSettings.PlaySound) { Beep(1000, 30); } } else { this._recordTimer.Stop(); FinishCapture(); } }
private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e) { MemoryStream stream1 = new MemoryStream(); e.FullSizeImage.Save(stream1, ImageFormat.Png); this.SendToOneNote(stream1.ToArray(), "Cropper Capture"); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { try { switch (PluginSettings.Format) { case ClipboardOutputFormat.Bitmap: Clipboard.SetImage(e.FullSizeImage); break; case ClipboardOutputFormat.Jpg: using (MemoryStream stream = new MemoryStream()) { SaveJpegImage(stream, e.FullSizeImage); using (Image bitmap = Bitmap.FromStream(stream)) Clipboard.SetDataObject(bitmap, true); } break; case ClipboardOutputFormat.Png: using (MemoryStream stream = new MemoryStream()) { e.FullSizeImage.Save(stream, ImageFormat.Png); using (Image bitmap = Bitmap.FromStream(stream)) Clipboard.SetDataObject(bitmap, true); } break; } } catch (ExternalException ex) { throw new InvalidOperationException("The image was not saved to the clipboard.", ex); } }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { Tracing.Trace("+--------------+"); Tracing.Trace("Email::ImageCaptured filename={0}", e.ImageNames.FullSize); this.output.FetchOutputStream(new StreamHandler(this.SaveImage), e.ImageNames.FullSize, e.FullSizeImage); FileInfo file = new FileInfo(e.ImageNames.FullSize); SendImageInEmail(file); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { Tracing.Trace("Picasa::{0:X8}::ImageCaptured", this.GetHashCode()); Hacks.BootstrapSettings(PluginSettings); this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e) { this._output.FetchOutputStream(new StreamHandler(this.SaveImage), e.ImageNames.FullSize, e.FullSizeImage); using (ScreenshotDetailsForm form = new ScreenshotDetailsForm(this, this.ProcessImage, e.ImageNames.FullSize)) { form.ShowDialog(); } }
protected void OnImageCaptured(ImageCapturedEventArgs e) { ImageCapturedEventHandler handler = ImageCaptured; if (handler != null) { handler(this, e); } }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { Tracing.Trace("+--------------------------------"); Tracing.Trace("TFSWI::ImageCaptured ({0})", _fileName); this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { if (!VerifyBasicSettings()) { return; } this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
void FireImageReceivedEvent(Frame frame) { if (this.ImageReceived != null) { ImageCapturedEventArgs args = new ImageCapturedEventArgs { FrameCaptured = frame, }; this.ImageReceived(this, args); } }
void FireImageReceivedEvent(Image img) { if (this.ImageReceived != null) { ImageCapturedEventArgs args = new ImageCapturedEventArgs { ImageCaptured = img, }; this.ImageReceived(this, args); } }
private void QueryRawFrame() { if (this.cpuOverLoaded()) { return; } byte[] image = null; lock (this.camLocker) { image = camera.CaptureImageBytes(); } MemoryStream memStream = new MemoryStream(image); Bitmap bmp = null; try { bmp = (Bitmap)Image.FromStream(memStream); } catch (System.ArgumentException)//图片格式出错 { MessageBox.Show("获取摄像头图片错误"); return; } if (ImageCaptured != null) { ImageCapturedEventArgs args = new ImageCapturedEventArgs() { ImageCaptured = bmp }; ImageCaptured(this, args); } Frame f = new Frame(); f.timeStamp = DateTime.Now.Ticks; f.cameraID = 2; IplImage ipl = BitmapConverter.ToIplImage(bmp); ipl.IsEnabledDispose = false; f.image = ipl; lock (this.rawFrameLocker) rawFrames.Enqueue(f); goDetectMotion.Set(); }
private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e) { if (record) { aviManager = new AviManager(e.ImageNames.FullSize, false); stream = aviManager.AddVideoStream(true, 10, (Bitmap)e.FullSizeImage); recordTimer.Start(); } else { recordTimer.Stop(); aviManager.Close(); } }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { if (PluginSettings.PlaySound) { Beep(4000, 30); } if (PluginSettings.WantLogging) { this._logger = new ImgurLogWriter(new FileInfo(e.ImageNames.FullSize).DirectoryName); } this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { try { MemoryStream imageStream = new MemoryStream(); e.FullSizeImage.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png); imageStream.Position = 0; UploadImageStream(imageStream, GenerateUniqueImageName(".png")); } catch (Exception ex) { MessageBox.Show(ex.Message, "Exception"); } }
private void CaptureByHdc(IntPtr hdc, bool cropAndColor) { OnImageCapturing(new ImageCapturingEventArgs()); using (Image image = NativeMethods.GetDesktopBitmap(hdc, cropAndColor, Color.FromArgb(Configuration.Current.NonFormAreaColorArgb))) { if (Configuration.Current.LeavePrintScreenOnClipboard) { Clipboard.SetImage(image); } ImageCapturedEventArgs imageCapturedEventArgs = ProcessCapturedImage(image, 0.0); OnImageCaptured(imageCapturedEventArgs); } }
private ImageCapturedEventArgs ProcessCapturedImage(Image image, double maxThumbnailSize) { ImageCapturedEventArgs imageCapturedEventArgs = new ImageCapturedEventArgs(); imageCapturedEventArgs.ImageNames = template.Parse(ImageFormat.Extension); imageCapturedEventArgs.FullSizeImage = image; imageCapturedEventArgs.IsThumbnailed = (maxThumbnailSize > 0.0); if (imageCapturedEventArgs.IsThumbnailed) { imageCapturedEventArgs.ThumbnailImage = CreateThumbnailImage(image, maxThumbnailSize); } lastImageCaptured = imageCapturedEventArgs.ImageNames.FullSize; return(imageCapturedEventArgs); }
/// <summary> /// Captures a screenshot and raises events that notify the loaded plugin. /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="maxThumbnailSize">A double representing the maximum thumbnail size.</param> /// <exception cref="InvalidOperationException">Thrown when the <see cref="ImageFormat"/> /// has not been properly set.</exception> public void Capture(int x, int y, int width, int height, double maxThumbnailSize) { if (ImageFormat == null) { throw new InvalidOperationException(SR.ExceptionImageFormatNull); } captureRectangle = new Rectangle(x, y, width, height); OnImageCapturing(new ImageCapturingEventArgs()); using (Image image = NativeMethods.GetDesktopBitmap(x, y, width, height)) { ImageCapturedEventArgs imageCapturedEventArgs = ProcessCapturedImage(image, maxThumbnailSize); OnImageCaptured(imageCapturedEventArgs); } }
void lc_ImageReceived(object sender, ImageCapturedEventArgs e) { ConnectInfo c = (sender as LiveClient).Tag as ConnectInfo; if (this.InvokeRequired) { Action <Image> updateImage = img => c.Target.Image = img; this.BeginInvoke(updateImage, e.ImageCaptured); } else { c.Target.Image = e.ImageCaptured; } this.squareListView1.Invalidate(c.Target.Rec); }
private void FingerprintEngineSampleCollected(object sender, ImageCapturedEventArgs e) { if (fingerprintImage != null) { fingerprintImage.Dispose(); } fingerprintImage = e.FingerprintImage; var writableBitmap = new WriteableBitmap(fingerprintImage.Width, fingerprintImage.Height, fingerprintImage.DpiX, fingerprintImage.DpiY, PixelFormats.Gray8, BitmapPalettes.Gray256); writableBitmap.Lock(); writableBitmap.WritePixels(new Int32Rect(0, 0, fingerprintImage.Width, fingerprintImage.Height), fingerprintImage.ImageData, fingerprintImage.Width * fingerprintImage.BitPerPixel / 8, 0); writableBitmap.Unlock(); FingerprintImage.Source = writableBitmap; //var fpImage = new Services.Fingerprints.FingerprintImage(); //fpImage.Header.DeviceType = 49264417347272704; //fpImage.Format.Bpp = PixelFormats.Gray8.BitsPerPixel; //fpImage.Format.ColorRepresentation = FingerprintImageColorRepresantation.NoColorRepresentation; //fpImage.Format.Height = fingerprintImage.Height; //fpImage.Format.Width = fingerprintImage.Width; //fpImage.Format.DpiX = fingerprintImage.DpiX; //fpImage.Format.DpiY = fingerprintImage.DpiY; //fpImage.Format.ImageType = FingerprintImageType.GrayScale; //fpImage.Format.Padding = FingerprintImagePadding.RightPadding; //fpImage.Format.Polarity = FingerprintImagePolarity.PositivePolarity; //fpImage.Format.SignificantBpp = 8; //fpImage.Format.Planes = 1; //fpImage.Data = fingerprintImage.ImageData; //fingerprintEnrollmentData.Add(new BiometricSample(fpImage, // BiometricSampleHeaderType.DigitalPersonaFingerprintImage)); using (var fe = new FingerprintFeatureExtractor()) { fe.Initialize(); var featuries = fe.Extract(fingerprintImage, ExtractionType.FeatureSetForEnrollment); fingerprintEnrollmentData.Add(new BiometricSample(featuries, BiometricSampleHeaderType.DigitalPersonaFingerprintFeatureSet)); } }
private void FingerprintEngineSampleCollected(object sender, ImageCapturedEventArgs e) { if (fingerprintImage != null) { fingerprintImage.Dispose(); } fingerprintImage = e.FingerprintImage; var writableBitmap = new WriteableBitmap(e.FingerprintImage.Width, e.FingerprintImage.Height, e.FingerprintImage.DpiX, e.FingerprintImage.DpiY, PixelFormats.Gray8, BitmapPalettes.Gray256); writableBitmap.Lock(); writableBitmap.WritePixels(new Int32Rect(0, 0, e.FingerprintImage.Width, e.FingerprintImage.Height), e.FingerprintImage.ImageData, e.FingerprintImage.Width * e.FingerprintImage.BitPerPixel / 8, 0); writableBitmap.Unlock(); FingerprintImage.Source = writableBitmap; }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { if (PluginSettings.WantChirp) { Beep(4000, 30); } ImagePairNames names1 = e.ImageNames; this._logger = new PdnLogWriter(new FileInfo(names1.FullSize).DirectoryName); if (this._isThumbEnabled = e.IsThumbnailed) { this._thumbFileName = e.ImageNames.Thumbnail; this._thumbnailImage = e.ThumbnailImage; } this._fileName = e.ImageNames.FullSize; output.FetchOutputStream(new StreamHandler(this.SaveImage), this._fileName, e.FullSizeImage); }
private void ImageCaptured(object sender, ImageCapturedEventArgs e) { Trace("captured"); if (copyToClipboard || (sendToPdn && !saveToFile)) { // put the image on the clipboard using (MemoryStream stream = new MemoryStream()) { e.FullSizeImage.Save(stream, ImageFormat.Png); using (Image bitmap = Bitmap.FromStream(stream)) Clipboard.SetDataObject(bitmap, true); } } if (saveToFile) { if (this._isThumbEnabled = e.IsThumbnailed) { this._thumbFileName = e.ImageNames.Thumbnail; this._thumbnailImage = e.ThumbnailImage; } this._fileName = e.ImageNames.FullSize; this.output.FetchOutputStream(new StreamHandler(this.SaveImage), e.ImageNames.FullSize, e.FullSizeImage); } else if (sendToPdn) { // not saving, but opening PDN try { System.Diagnostics.Process.Start(PdnExecutable); } catch { } } Beep(4000, 40); }
private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e) { FileStream stream1 = new FileStream(e.ImageNames.FullSize, FileMode.CreateNew); e.FullSizeImage.Save(stream1, ImageFormat.Png); stream1.Close(); if (e.IsThumbnailed) { stream1 = new FileStream(e.ImageNames.Thumbnail, FileMode.CreateNew); e.ThumbnailImage.Save(stream1, ImageFormat.Png); stream1.Close(); } if (this.ConfigExists) { Settings settings1 = new Settings(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AltmanSoftware.Cropper.FlickrOutput Plugin\AltmanSoftware.Cropper.FlickrOutput.config"); FlickrNet.Flickr flickr1 = new FlickrNet.Flickr("ab782e182b4eb406d285211811d625ff", "b080496c05335c3d", settings1.Token); PhotoDetails details1 = new PhotoDetails(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AltmanSoftware.Cropper.FlickrOutput Plugin\AltmanSoftware.Cropper.FlickrOutput.config"); if (details1.ShowDialog() == DialogResult.OK) { string text1 = flickr1.UploadPicture(e.ImageNames.FullSize, details1.Title, details1.Description, details1.Tags, details1.IsPublic, details1.IsFamily, details1.IsFriend); if ((details1.PhotoSetId != null) && (details1.PhotoSetId != string.Empty)) { MessageBox.Show(details1.PhotoSetId); flickr1.PhotosetsAddPhoto(details1.PhotoSetId, text1); } if (e.IsThumbnailed) { string text2 = flickr1.UploadPicture(e.ImageNames.Thumbnail, details1.Title + " Thumbnail", details1.Description, details1.Tags, details1.IsPublic, details1.IsFamily, details1.IsFriend); if ((details1.PhotoSetId != null) && (details1.PhotoSetId != string.Empty)) { flickr1.PhotosetsAddPhoto(details1.PhotoSetId, text2); } } } } }
void lc_ImageReceived(object sender, ImageCapturedEventArgs e) { ConnectInfo c = (sender as LiveClient).Tag as ConnectInfo; if (this.InvokeRequired) { Action<Image> updateImage = img => c.Target.Image = img; this.BeginInvoke(updateImage, e.ImageCaptured); } else { c.Target.Image = e.ImageCaptured; } this.squareListView1.Invalidate(c.Target.Rec); }
protected override void ImageCaptured(object sender, ImageCapturedEventArgs e) { capturedImage = e.FullSizeImage; Print(); }
void lc_ImageReceived(object sender, ImageCapturedEventArgs e) { }