private void RefreshStillImage() { if (ImageProcesser.ImageLoadState == ImageProcesser.LoadState.Still) { ImageProcesser.DisposeWorkingBitmap(); ImageProcesser.WorkingBitmap = ImageProcesser.CropBitmap(ImageProcesser.LoadedStillBitmap, ImageProcesser.ImageRect); ContentBitmap = MatrixFrame.CreateBitmapSourceFromBitmap(ImageProcesser.WorkingBitmap); MatrixFrame.BitmapToFrame(ImageProcesser.WorkingBitmap, ImageProcesser.InterpMode); //FrameToPreview(); //SerialManager.PushFrame(); } }
private void GifTimer_Tick(object sender, EventArgs e) { ImageProcesser.DisposeWorkingBitmap(); if (_gifFrameIndex >= ImageProcesser.LoadedGifFrameCount - 1) { _gifFrameIndex = 0; } else { _gifFrameIndex++; } ImageProcesser.LoadedGifImage.SelectActiveFrame(ImageProcesser.LoadedGifFrameDim, _gifFrameIndex); ImageProcesser.WorkingBitmap = ImageProcesser.CropBitmap(new Bitmap(ImageProcesser.LoadedGifImage), ImageProcesser.ImageRect); ContentBitmap = MatrixFrame.CreateBitmapSourceFromBitmap(ImageProcesser.WorkingBitmap); MatrixFrame.BitmapToFrame(ImageProcesser.WorkingBitmap, ImageProcesser.InterpMode); ImageProcesser.DisposeWorkingBitmap(); //SerialManager.PushFrame(); }
private void RefreshGifImages() { if (ImageProcesser.ImageLoadState == ImageProcesser.LoadState.Gif) { ImageProcesser.DisposeWorkingBitmap(); if (GifPlayPause != true) //if gif is not playing { if (_gifFrameIndex > ImageProcesser.LoadedGifFrameCount - 1) { _gifFrameIndex = 0; } ImageProcesser.WorkingBitmap = ImageProcesser.CropBitmap(new Bitmap(ImageProcesser.LoadedGifImage), ImageProcesser.ImageRect); ContentBitmap = MatrixFrame.CreateBitmapSourceFromBitmap(ImageProcesser.WorkingBitmap); MatrixFrame.BitmapToFrame(ImageProcesser.WorkingBitmap, ImageProcesser.InterpMode); //FrameToPreview(); //SerialManager.PushFrame(); } } }