Skip to main content

Timeline for Rectangle with rounded edges

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Nov 26, 2012 at 22:23 history edited kglr CC BY-SA 3.0
added 458 characters in body
Nov 26, 2012 at 22:18 comment added kglr @ssch and Jens,thank you both. Will update with your suggestions.
Nov 26, 2012 at 17:45 comment added ssch I made a function to automate the handling of image size: roundImage[img_, r_] := Module[{dim = ImageDimensions[img], sr}, sr = Max[dim]*r; SetAlphaChannel[img, Graphics[{White, Rectangle[Scaled[{0, 0}], Scaled[{1, 1}], RoundingRadius -> sr]}, Background -> Black, PlotRangePadding -> 0, PlotRange -> {{0, 0}, dim}\[Transpose], AspectRatio -> Automatic] ]]
Feb 17, 2012 at 18:51 comment added Jens In case you want to layer these rectangles on top of other graphics, it may be a slight improvement to change the masking procedure to an actual alpha mask by doing something like this: pic2 = SetAlphaChannel[pic, Graphics[{White, Rectangle[{2, 1}, {4, 2}, RoundingRadius -> .2]}, Background -> Black, PlotRangePadding -> None]] (you'll see the difference only if you display the result with a background.
Feb 17, 2012 at 16:51 vote accept 500
Feb 16, 2012 at 21:14 history edited kglr CC BY-SA 3.0
added 214 characters in body
Feb 16, 2012 at 20:58 history edited kglr CC BY-SA 3.0
added 140 characters in body
Feb 16, 2012 at 20:23 history answered kglr CC BY-SA 3.0