void LoadImageStream(Stream stream) { bitmap.SetStream(stream); imageGrid.Width = bitmap.Width; imageGrid.Height = bitmap.Height; selection = new Rect(0, 0, bitmap.Width, bitmap.Height); UpdateMask(); }
void LoadImageStream(Stream stream) { bitmap.SetStream(stream); if (bitmap.Width * bitmap.Height > imageSize) { var scale = Math.Sqrt(imageSize * 1.0 / (bitmap.Width * bitmap.Height)); var resizedBitmap = new C1Bitmap((int)(bitmap.Width * scale), (int)(bitmap.Height * scale)); resizedBitmap.Copy(bitmap, true); bitmap = resizedBitmap; } originalBitmap.Copy(bitmap, false); screen.Copy(bitmap, false); imageGrid.Width = screen.Width; imageGrid.Height = screen.Height; }