WithBoxSize() public method

Retuns a copy of the image with a size that fits the provided size limits
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithBoxSize ( Size size ) : Image
size Size Max width and height
return Image
Ejemplo n.º 1
0
        private void InitializeUI(BaseScan scan, Image thumbnail)
        {
            mScan = scan;

            Icon = thumbnail;
            Title = scan.Name;

            Buttons.Add(new DialogButton(Command.Cancel));
            Buttons.Add(new DialogButton(Command.Apply));

            Font fontH1 = Font.SystemFont.WithStyle(FontStyle.Oblique).WithSize(16);
            Font fontH2 = fontH1.WithStyle(FontStyle.Normal).WithSize(12);

            VBox mainLayout = new VBox();
            Content = mainLayout;

            HBox overviewLayout = new HBox();
            VBox overviewDataLayout = new VBox();

            ImageView thumbnailView = new ImageView(thumbnail.WithBoxSize(96));
            nameEntryUnedited.Text = scan.Name;
            nameEntryUnedited.Font = fontH1;

            fiberTypeEntryUnedited.Text = scan.FiberType;
            fiberTypeEntryUnedited.Font = fontH2;

            nameEntry.Text = scan.Name;
            nameEntry.Visible = false;
            nameEntry.Font = fontH1;

            fiberTypeEntry.Text = scan.FiberType;
            fiberTypeEntry.Visible = false;
            fiberTypeEntry.Font = fontH2;

            overviewDataLayout.MarginTop = 4;
            overviewDataLayout.MarginLeft = 4;
            overviewDataLayout.PackStart(nameEntryUnedited);
            overviewDataLayout.PackStart(nameEntry);
            overviewDataLayout.PackStart(fiberTypeEntryUnedited);
            overviewDataLayout.PackStart(fiberTypeEntry);

            overviewLayout.PackStart(thumbnailView);
            overviewLayout.PackStart(overviewDataLayout, true, true);

            MetadataView mView = new MetadataView();
            mView.Load(scan);

            ScrollView mViewScroller = new ScrollView { Content = mView, BorderVisible = false };

            mainLayout.PackStart(overviewLayout);
            mainLayout.PackStart(mViewScroller, true, true);
        }
Ejemplo n.º 2
0
 public ButtonSegment(SegmentType segmentType, Image icon, bool toggleButton = false)
 {
     SegmentType = segmentType;
     this.icon = icon.WithBoxSize(bg[0].Size);
     this.toggleButton = toggleButton;
 }