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