Package cli.System.Drawing

Examples of cli.System.Drawing.RectangleF


                    if (firstResponder == null) return; // it's not a field we're managing, bail

                    // figure out how we need to transform the game view
                    SizeF size = ((NSValue) nf.get_UserInfo().get_Item(
                        UIKeyboard.get_FrameBeginUserInfoKey())).get_RectangleFValue().get_Size();
                    RectangleF fieldFrame = firstResponder.getView().get_Frame();
                    // oddly, the size given for keyboard dimensions is portrait, always.
                    float targetOffset = -size.get_Width() +
                        _overlay.get_Bounds().get_Height() - fieldFrame.get_Bottom();
                    // give it a little padding, and make sure we never move the game view down,
                    // also make sure we never move the bottom of the game view past the top of the
                    // keyboard
                    targetOffset = Math.max(Math.min(targetOffset - 10, 0), -size.get_Width());
                    PointF target = new PointF(0, targetOffset);
View Full Code Here


        return false;
    }

    public void setHiddenArea (IRectangle area) {
        _hidden = area == null ? null : new RectangleF(area.x(), area.y(),
            area.width(), area.height());

        if (_hidden == null) {
            get_Layer().set_Mask(null);
            return;
        }

        RectangleF bounds = get_Bounds();
        CAShapeLayer maskLayer = new CAShapeLayer();
        // draw four rectangles surrounding the area we want to hide, and create a mask out of it.
        CGPath path = new CGPath();
        // top
        path.AddRect(new RectangleF(0, 0, bounds.get_Width(), _hidden.get_Top()));
        // bottom
        path.AddRect(new RectangleF(0, _hidden.get_Bottom(), bounds.get_Width(),
            bounds.get_Bottom() - _hidden.get_Bottom()));
        // left
        path.AddRect(new RectangleF(0, _hidden.get_Top(), _hidden.get_Left(), _hidden.get_Height()));
        // right
        path.AddRect(new RectangleF(_hidden.get_Right(), _hidden.get_Top(), bounds.get_Right()
            - _hidden.get_Right(), _hidden.get_Height()));
        maskLayer.set_Path(path);
        get_Layer().set_Mask(maskLayer);
    }
View Full Code Here

          break;
        }

        _uiOverlay.set_Transform(trans);

        RectangleF overlayBounds = _uiOverlay.get_Bounds();
        if ((overlayBounds.get_Width() > overlayBounds.get_Height()) != landscape) {
          // swap the width and height
          float width = overlayBounds.get_Width();
          overlayBounds.set_Width(overlayBounds.get_Height());
          overlayBounds.set_Height(width);
          _uiOverlay.set_Bounds(overlayBounds);
        }
        // update the overlay's hidden area, if any
        _uiOverlay.setHiddenArea(_hidden);
    }
View Full Code Here

     * Updates the bounds to match the currently requested bounds, giving subclasses an
     * opportunity to adjust.
     */
    protected void updateBounds () {
        if (_bounds == null) return;
        RectangleF bounds = new RectangleF(_bounds.x(), _bounds.y(),
            _bounds.width(), _bounds.height());
        adjustBounds(bounds);
        view.set_Frame(bounds);
    }
View Full Code Here

        } else {
          return MEDIA_NAMES[ rawKind - 1 ];
        }
      }
      if (category == MediaPrintableArea.class) {
        RectangleF area = settings.get_DefaultPageSettings().get_PrintableArea();
        // get_PrintableArea is in 1/100 inch, see http://msdn.microsoft.com/de-de/library/system.drawing.printing.pagesettings.printablearea(v=VS.90).aspx
        return new MediaPrintableArea(area.get_X()/100, area.get_Y()/100, area.get_Width()/100, area.get_Height()/100, MediaPrintableArea.INCH);
      }
      if (category == Destination.class) {
        String path = "out.prn";
        try {
          return new Destination( ( new File( path ) ).toURI() );
View Full Code Here

                             StringFormatFlags.FitBlackBox ));
        format.set_Trimming( StringTrimming.wrap( StringTrimming.None ) );
        format.SetMeasurableCharacterRanges(new CharacterRange[] {new CharacterRange(0, 1)});
        Graphics g = createGraphics( frc );
        Region[] regions = g.MeasureCharacterRanges(String.valueOf((char)cp), font.getNetFont(),
                                                    new RectangleF(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE), format);
        SizeF size = regions[0].GetBounds(g).get_Size();
        regions[0].Dispose();
        return frc.usesFractionalMetrics() ? size.get_Width() :  Math.round(size.get_Width());
    }
View Full Code Here

TOP

Related Classes of cli.System.Drawing.RectangleF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.