BioGTK  6.7.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
Loading...
Searching...
No Matches
About.cs
1extern alias BioFormats6;
2using Gdk;
3using Gtk;
4using System;
5using System.Collections.Generic;
6using System.IO;
7using System.Linq;
8using System.Text;
9using System.Threading.Tasks;
10
11namespace BioGTK
12{
13
14 /* It's a window that displays the version of the program and the author */
15 public class About : Gtk.Window
16 {
17 #region Properties
18 Pixbuf pixbuf;
19 private Builder _builder;
20#pragma warning disable 649
21 [Builder.Object]
22 private Gtk.DrawingArea image;
23 [Builder.Object]
24 private Gtk.Label label;
25#pragma warning restore 649
26 #endregion
27
28 #region Constructors / Destructors
29
33 public static About Create()
34 {
35 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/About.glade", FileMode.Open));
36 return new About(builder, builder.GetObject("about").Handle);
37 }
38
39
40 /* It's the constructor of the class. */
41 protected About(Builder builder, IntPtr handle) : base(handle)
42 {
43 _builder = builder;
44 builder.Autoconnect(this);
45 string s = System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/";
46 pixbuf = new Pixbuf(s + "Images/banner.jpg");
47 label.Text = "Bio-Formats version:" + loci.formats.FormatTools.VERSION + " , BioGTK " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + " by Erik Repo, Github.com/BiologyTools/BioGTK.";
48 image.Drawn += Image_Drawn;
49 this.DeleteEvent += About_DeleteEvent;
50 App.ApplyStyles(this);
51 }
52
53 private void About_DeleteEvent(object o, DeleteEventArgs args)
54 {
55 this.Hide();
56 }
57
65 private void Image_Drawn(object o, DrawnArgs e)
66 {
67 Pixbuf pf = pixbuf.ScaleSimple(image.AllocatedWidth, image.AllocatedHeight, InterpType.Bilinear);
68 Gdk.CairoHelper.SetSourcePixbuf(e.Cr,pf,0,0);
69 e.Cr.Paint();
70 e.Cr.Stroke();
71 }
72
73 #endregion
74
75 }
76}
static About Create()
Definition About.cs:33
Definition ML.cs:17