BioImager  5.0.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
ImageView.Layout.cs
Go to the documentation of this file.
1namespace BioImager
2{
3 public partial class ImageView
4 {
5 private void InvalidateView()
6 {
7 UpdateRenderSurfaceMode();
8 UpdateScrollBars();
9 overviewPanel.Invalidate();
10 if (SelectedIndex >= 0 && SelectedIndex < Images.Count && UsesSlideRenderer(Images[SelectedIndex]))
11 gl.Invalidate();
12 else
13 viewpanel.Invalidate();
14 }
15
16 protected override void OnLayout(LayoutEventArgs e)
17 {
18 base.OnLayout(e);
19 if (viewpanel == null || statusPanel == null || trackBarPanel == null ||
20 hScrollBar == null || vScrollBar == null)
21 return;
22
23 int top = showStatus ? statusPanel.Bottom : 0;
24 int bottom = showControls ? trackBarPanel.Top : ClientSize.Height;
25 bool pyramidal = SelectedIndex >= 0 && SelectedIndex < Images.Count && UsesSlideRenderer(Images[SelectedIndex]);
26 int width = Math.Max(0, ClientSize.Width - (pyramidal ? vScrollBar.Width : 0));
27 int height = Math.Max(0, bottom - top - (pyramidal ? hScrollBar.Height : 0));
28 viewpanel.Bounds = new System.Drawing.Rectangle(0, top, width, height);
29 hScrollBar.SetBounds(0, top + height, width, hScrollBar.Height);
30 vScrollBar.SetBounds(width, top, vScrollBar.Width, height);
31 UpdateScrollBars();
32 }
33 }
34}
List< BioImage > Images
Definition ImageView.cs:323
override void OnLayout(LayoutEventArgs e)
int SelectedIndex
A property that is used to set the selected index of the image. *‍/.
Definition ImageView.cs:390