Rounded rectangle, mains

Once again, greetings

I try to draw a rounded rectangle with a texture bitmap inside it and transparent corners.  I have an application that works, but it is so sloppy that I hoped to find a better way to do it.

The approach I took was to draw the bitmap first, then use clear to clear points in the corners.

I used this algorithm to help find the points that should be deleted: http://www.cs.unc.edu/~mcmillan/comp136/Lecture7/circle.html

Can you think of an easier way to do that using existing code as drawRoundRect and drawArc methods?

You can ask the Graphics object drawTexturedPath with your Bitmap image as one of the parameters.

Since you need rounded rectangle, your path should include different types of points.

For example, if your top left corner (x, y) and the radius of your arc is r, your way will include 3 points:

(x, y + r) (x + (int) (r * (1 - Math.sqrt (2.))), y + (int) (r * (1 - Math.sqrt (2.))) and (x + r, y).)  The first and the third point will have CURVEDPATH_END_POINT type while the middle point will have  type of CURVEDPATH_QUADRATIC_BEZIER_CONTROL_POINT .

Other corners will need similar treatment.  Also, I remember seeing a notice of appeal

graphics.setDrawingStyle (DRAWSTYLE_AAPOLYGONS, false) before your drawTexturedPath - search the forums for more details.

Good luck!

Tags: BlackBerry Developers

Similar Questions

  • drawing of a star that appears in the form of a rounded rectangle?

    Screenshot 2016-01-10 08.16.23.pngScreenshot 2016-01-10 08.19.47.png

    Hello, I'm trying to draw a star, but it is indicated by a rounded rectangle. In the appearance Panel, it said "rounded rectangle", too. I do not understand why I messed up. If anyone can, please explain what is happening? Thank you.

    You probably already understand that the appearance panel shows you the effect called (convert to shape) "Rounded Rectangle" change the outcome of your spline paths.

    If you turn off the eyeball in this Panel, or select the effect layer and remove the rounded Rectangle, the illustration will be back to its original look (Star) - or whatever it is you put in appearances.

    There are a lot of great tours for the appearance Panel: using Illustrator | Control the appearance Panel

    HTH

  • I have photoshop cs2. I would like to add or insert a jpg or gif image/image layer in photoshop created with the "Rounded Rectangle tool. How would I do that?

    Screenshot_1.jpg

    The background photo/image is a layer

    I would like to add the image/photo of this layer to the white layer that has been created with the tool "rounded rectangle", and then delete the background layer and you end up with an image/icon with corners rounded

    Turn on your background layer to a regular layer by double clicking on the thumbnail in the layers palette.

    Then add a vector mask to the layer by going to layer > vector mask > reveal all the

    Then set the Rectangle rounded to path tool and draw your Rectangle on the vector mask.

  • Help!  I'm stuck.  No, not the child into the well.  I took a picture and put a second layer top with a rounded rectangle to make a frame.  My problem is that I need to find a way to hide the small box outside the box on the second layer.  Thanks to

    Help!  I'm stuck.  No, not the child into the well.  I took a picture and put a second layer top with a rounded rectangle to make a frame.  My problem is that I need to find a way to hide the small box outside the box on the second layer.  Thanks to all those who can help you.

    Another option is to put the Options bar of the Rectangle rounded to the path tool

    Trash bolt for the background layer, hold down the Cmd key and click on the symbol of the new layer to layer below the image to white. Then edit > fill with white.

    Return the image layer and draw the image as a path

    Click the load as a selection path in the Panel traced

    Edit > stroke and stroke with color

    Select > Inverse > delete

  • Make a few points on rounded rectangle corner points

    Hello

    I work at the CS6. I would like to cut through a rounded rectangle, so that the result is that one side of computing the corners remain rounded, while the other side they become points of right angle to angle. How can I cut through the rounded without all four sides remaining rounded rectangle?

    Thank you!

    BF,

    I believe you have the effect > esthetics > applied rounded corners.

    Unless you need closed, you can as I suggested in the first post (only ShiftClickDragging with the tool above the sides side line Segment), then uncheck the box and select Direct from the top and press the delete key to leave open at the top.

    Or you can create with the height and the width you want in the first place and just delete the upper side (Direct select it).

    Or you can oppose > decompose the aspect to make it a real rounded Rectangle until you cut.

  • Premiere Pro cs6 how to adjust the radius of rounded rectangle

    I think that my title covers my question.

    How to set the rectangle with corners RADIUS rounded in Premiere Pro CS6? Trying to make a lower third and don't want exaggerated rounded corners.  Is there a way to set the radius of the corner?

    Thank you

    It there is no option to change the radius of (CRA) corner of the rounded rectangle and no other way that I never discovered in the Titler, to make a decent shape for her.

    Adobe Illustrator will do a better job.

  • Eccentric rounded Rectangles

    I have a few rounded rectangles I'd like to compete. Unfortunately, these are not alive rounded corners. They have been expanded aspect.

    Is there any clever script which allows to get in and re-square rounded rectangles?

    Try the plugin VectorScribe

  • Resize the rounded Rectangle

    In oracle Froms 10 can adjust you the size of a rectangle rounded running. for example if all the items displayed in a form are surrounded by a rounded rectangle and the number of items displayed varies based on search criteria the canvas is resized to fit the items displayed, but the bottom of the rectangle can be seen in all cases

    Hope it makes sense
    Tina

    Graphics, added to a canvas cannot be treated at execution.

    François

  • Set rounded rectangle roundness in pixels RADIUS?

    If I create a rounded rectangle, it is possible to define a dimension of pixel on the radius of the corner rather than by dragging the handle and do it by eye?

    Thank you

    Yes. Replace the default % px value in the properties panel. You can also enter an exact RADIUS in the auto shape properties panel if you use rectangle auto shape rounded instead of a regular rectangle.

  • Splitting of a rounded rectangle

    I have a square with rounded edges. I want to fill half of it with color. Normally I drop another rectangle on it in the Middle, and then use the pathfinder tool to split half, I want color and half, I don't. But with the rounded rectangle, which creates new rounded edges where I'm square. Solutions?

    It sounds like the rounded corners are applied as an effect. What you need to do is rather to draw your place using the rounded rectangle tool. Then you can cut that in half (various methods available as well as the Pathfinder) and the angles will be square to each side of the cut.

  • Creation of rounded Rectangle outline color question

    Hi all

    I am wanting to create a rounded rectangle with an outline or a boarder with a black color (or other colors). But I can't find where I'm able to add a stroke optional color before drawing, form or after the design of the shape.

    The only option that I am able to change the background color of the created shape, and I was wondering if you are able to add a preview when creating, or after you have created a rounded rectangles or other shapes...

    Thank you

    James

    But I can't find where I'm able to add a stroke optional color before drawing, form or after the design of the shape.

    Styles-> stroke.

  • Annoyed is not in PSCS5X: rounded rectangle

    I usually draw shapes and several times in order to give something a nice curved edge, I have to create a new layer, use a rounded rectangle tool to make another shape, load this layer as a selection, refocus the layer I want and then perform the action (deletion or SELECTION REVERSE then delete)

    I am very surprised Photoshop does not give the rectangle selection rectangle, the possibility of having rounded edges.

    Hello Aegis,

    I have a solution more simple that can relieve your headaches.  Don't know why I thought not before, because you have mentioned using the rounded Rectangle tool...

    How does this sound like a possible workflow for you.

    1. choose the rounded Rectangle tool.

    2. click the icon of access paths so that the tool is an outline of a path.

    3. "select" box that you want with the rounded Rectangle tool.

    4 to convert the path to a selection.

    This could be a lot easier than what you've done, no?  And the path shows you exactly what the selection will eventually look like.

    Step 4 could be placed on action that could be attributed to a function key.

    -Christmas

  • Creation of a uniform within a rounded rectangle gradient

    Hello

    I am trying to create a uniform gradient in a rounded rectangle. I tried a gradient mesh, but the 2 sides are too dark and I also tried a normal gradient, but that does not create a dark shadow on 2 sides according to the attached picture. How can I create a uniform gradient smooth along all sides please?Screen shot 2010-11-05 at 10.52.33.png

    Sometimes, just using an inner glow effect can be satisfactory as well.

  • Where is the rounded Rectangle tool?

    Hell

    I'm new to AI cs5.

    I'm going nuts trying to make a rectangle with rounded corners.  I know there is a 'rounded rectangle tool' somewhere, but I can't.  Your help is appreciated.

    s!

    At least in older versions this is in the dialog box of the Rectangle tool, which should appear when you ClickHold.

    If it does not appear, your preferences are damaged. You can try to press Ctrl + Alt + Shift / Cmd + Option + shift at startup to clear them.

  • HELP - strange behavior rounded Rectangle - cannot select Anchor Points

    Good day to you all, I hope someone can help out me.

    I have a strange problem with my Illustrator CS3.

    I worked on an illustration for hours without any problem and the graphics requires me to do a lot of "buttons". I used the rectangular shape with AESTHETIC tool > > button CORNERS ROUNDED to create different forms without any problem whatsoever.

    All of a sudden (without close AICS3), all my NEWLY CREATED rectangles behave strangely.

    None of my new rectangles allowed me to individually select anchor points. As you know, when you create a rounded rectangle, you'll find yourself with 8 points (2 per corner) compared with 4 anchor points in a normal rectangle. In this case, all of my new rounded rectangles show only 4 points.

    When I choose the direct Selection (white arrow) tool, I can not select on the path itself and only the limit is displayed (with corner WHITE, no black points). Adjust this flat bounding box / distorts my rectangle, while the scales of adjustment with the black arrow rectangle. I can't use the scissors tool either. I can't add/remove is a path with the pen tool.

    I can't select individual anchor points.

    All of the 'old' generated rectangles are fine, I can select each path and anchor individually, but all rectangles later do not allow me to do.

    To add to the confusion, this only happens with rectangles. As you can see with the picture below. I can create any simple or complex form/paths, and I can choose individual anchors with no problems. Can I use the tool scissors without any problem or even the tool pen to add/remove a path to all other forms BUT the rectangle with corners rounded...

    http://i9.photobucket.com/albums/a69/theveed/Untitled-1-12.gif

    Only the rounded rectangle tool shows the anchor 'blue '. Note that all four forms have been selected with the direct Selection (white arrow) tool. If I used the black arrow, then the selection should have been outside of the black lines of the rounded rectangle.

    What is going on? I deleted the AIPrefs, it isn't CTRL-H, I am really confused...

    Help, please. Thank you very much

    Dave

    As you know, when you create a rounded rectangle, you'll find yourself with 8 points (2 per corner) compared with 4 anchor points in a normal rectangle. In this case, all of my new rounded rectangles show only 4 points.

    Yes, as it should be. Rounded corners is an effect and unrelated to the native rounded rectangle tool. In order for the paths, the effect should be expanded using the object--> Expand.

    Mylenium

Maybe you are looking for