public Player (AspectFrame aspectFrame) { this.frame = aspectFrame; InitializeSocket(); InitializePositionWatcher(); InitializePlaybin(); }
void validateImage(string path, AspectFrame reference) { Gdk.Pixbuf pixbuf = null; try { ReferenceStore.validateImage (path); DiffComputer_.LaunchRecompute(); } catch (Exception x) { statusbartext (x.Message); System.Console.WriteLine (x.Message); pixbuf = Stetic.IconLoader.LoadIcon (this, "gtk-dialog-error", IconSize.LargeToolbar); pixbuf.Data ["tooltip"] = x.Message; if (reference.Child != null) reference.Remove (reference.Child); reference.Child = PixbufCache.createImage (pixbuf); updateAspect (reference); if (pixbuf.Data.ContainsKey ("tooltip")) reference.Child.TooltipText = pixbuf.Data ["tooltip"] as string; reference.ShowAll (); } }
void updateAspect(AspectFrame af) { Image img = af.Child as Image; if (img != null && img.Pixbuf != null) { af.Set( 0.5f, 0.5f, img.Pixbuf.Width/(float)img.Pixbuf.Height, false ); } }
Widget createDiffWidget(AspectFrame af, AspectFrame af2, PixbufDiff diff) { VBox sumbox = new VBox (); sumbox.Add (createAspectFrame( diff.Diff )); Label infotext = new Label (diff.diffstring); infotext.LineWrap = true; sumbox.Add (infotext); Box.BoxChild infotextbc = ((Box.BoxChild)(sumbox [infotext])); infotextbc.Expand = false; sumbox.Add (new VBox ()); int mywidth = 24; Image arrow = new Image (); arrow.Pixbuf = Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", IconSize.LargeToolbar); Button button = new Button (); button.SetSizeRequest (mywidth, 15); button.Add (arrow); button.Clicked += (object sender, EventArgs e) => validateImage (diff.Path, af2); sumbox.Add (button); sumbox.Add (new VBox ()); Gdk.Pixbuf pixbuf; if (af2.Child.Data ["pixbuf"] != null) pixbuf = af2.Child.Data ["pixbuf"] as Gdk.Pixbuf; else pixbuf = af.Child.Data ["pixbuf"] as Gdk.Pixbuf; int height = pixbuf.Height; int width = pixbuf.Width; this.SizeAllocated += (o, args) => { int scrollbarwidth = 20; sumbox.SetSizeRequest (mywidth, (this.Allocation.Width - mywidth - scrollbarwidth) / 2 * height / width); }; return sumbox; }
AspectFrame createAspectFrame(Gdk.Pixbuf pixbuf) { AspectFrame af = new AspectFrame(null, 0.5f, 0.5f, 1, false); af.Child = PixbufCache.createImage(pixbuf); updateAspect(af); return af; }
private void InitializeVideoFrame () { /* Create frame */ frame = new AspectFrame(null, 0.5f, 0.5f, 1.6f, false); frame.Shadow = ShadowType.None; /* Create event box */ EventBox videoFrameEventBox = new EventBox(); videoFrameEventBox.Add(frame); videoFrameEventBox.ModifyBg(StateType.Normal, videoFrameEventBox.Style.Black); /* Attach event box */ Table videoImageTable = Base.GetWidget("videoImageTable") as Table; videoImageTable.Attach(videoFrameEventBox, 0, 1, 0, 1); videoImageTable.ShowAll(); }