Miranor Widget Store


You have to be logged in to use this function.


   Create New Account ˖ Forgot password?
ROUNDED RECT POINTS (Design App)Buy this Widget!
1 Credits

Returns the array of points ('MVector' of 'MPoint' objects). If this result is passed to 'MWindow::drawPoly' or 'MWindow::fillPoly', it will paint a rectangular shape (bounded by 'boundingBox') with rounded edges ('roundRadius' determines the rounding size). The roundings are Bezier curves, not circular arcs, however, so you can't use this function to draw a full circle (use MWindow::drawArc or MWindow::fillArc for this). This function doesn't do any painting itself.

Author: Dimitry Rotstein

Tags: rect, rectangle, button, outline, background, element, draw, paint, fill, line, curve, spline, Bezier, poly

Code preview:

MPoints roundedRectPoints(const MRect& boundingBox, MSizeElem roundRadius) { // Prepare MPoints res; if (!IsValid(boundingBox)) return res; // Ignore invalid input const MRect r = boundingBox; // For convenience const MSizeElem dx = ToRange(roundRadius, 1.0, r.w/2-1); const MSizeElem dy = ToRange(roundRadius, 1.0, r.h/2-1); // Calculate points of the rounded rect for drawPoly/fillPoly commands res.append( MPoint(r.x+r.w*0.5, r.y) ); res.append( MPoint( r.x+r.w-dx, r.y) );

***************Buy the widget to get the rest of the code***************

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.

Real Time Web Analytics