public void SetCapture(CaptureView capture) { Capture = capture; Region.SetParentCapture(capture); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Capture))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Region))); }
public void SetParentCapture(CaptureView parent) { Parent = parent; isCaptureSet = true; var star1 = Parent.GetVisiblePositionFromChipPosition(ChipX1, ChipY1); var star2 = Parent.GetVisiblePositionFromChipPosition(ChipX2, ChipY2); VisibleX = star1.X; VisibleY = star1.Y; VisibleWidth = star2.X - star1.X; VisibleHeight = star2.Y - star1.Y; var x2 = VisibleX + VisibleWidth; var y2 = VisibleY + VisibleHeight; var maxX = Parent.GetWidth(); var maxY = Parent.GetHeight(); CaptureWidth = maxX; CaptureHeight = maxY; if (VisibleWidth == 0 || VisibleHeight == 0 || VisibleX < 0 || VisibleY < 0 || x2 >= maxX || y2 >= maxY) { isClipped = true; } else { isClipped = false; } var xSize = VisibleWidth; var ySize = VisibleHeight; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ZoomedX))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ZoomedY))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ZoomedWidth))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ZoomedHeight))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(VisibleX))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(VisibleY))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(VisibleWidth))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(VisibleHeight))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(RegionVisibility))); RefreshZoom(zoom); }