rounded-corners

How can I work around Android issue 9161, where bottomRightRadius and bottomLeftRadius are swapped?

孤人 提交于 2019-11-27 04:27:45
问题 My goal: Figure 1: The Goal So, before I knew about the issue, here's what I tried. First, a base layout: <LinearLayout android:orientation="horizontal" android:layout_below="@id/heading" android:layout_marginTop="10dp" android:layout_width="@dimen/horizontal_two_button_width" android:layout_height="@dimen/button_height_small" > <Button android:id="@+id/button_one" android:layout_width="0dp" android:layout_weight="1.0" android:layout_height="fill_parent" android:padding="10dp" style="@style

Algorithm for creating rounded corners in a polygon

不想你离开。 提交于 2019-11-27 04:10:39
问题 I'm looking for an algorithm that allows me to create rounded corners from a polygon. In Input, I get an array of points that represents the polygon (red line) and in output, an array of points that represents the polygon with rounded corner (black line). I would also like to have a way to control the radius of each corner. I already tried to use Bezier and Subdivision but it's not what I'm looking for. Bezier and Subdivision are smoothing all the polygon. What I want, it's only make the

Adding rounded corners to a mapview

那年仲夏 提交于 2019-11-27 03:46:16
问题 I'm trying to code a simple MapActivity which uses the following layout (only contains the mapview for the moment, as I plan to add share the screen with a ListView in the future) : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="200dip"

how to set cornerRadius for only bottom-left,bottom-right and top-left corner textview?

拥有回忆 提交于 2019-11-27 03:30:32
How to set corner radius only only bottom-left,bottom-right and top-left corner textview? let rectShape = CAShapeLayer() rectShape.backgroundColor = UIColor.redColor().CGColor rectShape.bounds = messages.frame rectShape.position = messages.center rectShape.path = UIBezierPath(roundedRect: messages.bounds, byRoundingCorners: .BottomLeft | .TopRight, cornerRadii: CGSize(width: 20, height: 20)).CGPath messages.layer.addSublayer(rectShape) this code create two rect. I dont know why. Shailesh Chandavar You just need to mask the layer as shown below: For Swift 3 : let rectShape = CAShapeLayer()

How to create image with rounded corners in C#?

江枫思渺然 提交于 2019-11-27 02:51:33
问题 I'd like to create image (from another one) with rounded corners with GDI+. What's the best way to do this? PS: it's not for web, so I cannot make use of client CSS 回答1: This function seems to do what you want. It can also easily be modified to return a Bitmap if needed. You'll also need to clean up any images you no longer want, etc.. Adapted from: http://www.jigar.net/howdoi/viewhtmlcontent98.aspx using System.Drawing; using System.Drawing.Drawing2D; public Image RoundCorners(Image

Rounded transparent _smooth_ corners using imagecopyresampled() PHP GD

懵懂的女人 提交于 2019-11-27 01:56:43
问题 I need a script which makes rounded transparent corners on supplied image. I've found one and it works good except the one thing: the applied corners do not look smooth. The imageantialias() throws Fatal Error since PHP is running on Debian and re-compiling it is not an option. The trick I've found to make those corners look smooth is resizing the image with imagecopyresampled() as the following: prepare the image; imagecopyresample it to 10x size; draw corners with a special colour; make

Rounded side, not rounded corners

此生再无相见时 提交于 2019-11-27 01:19:11
问题 I'd like to create a shape like the one displayed below entirely in CSS. As you can tell, it would take a bit more tweaking than simply applying rounded corners... Can it be done? 回答1: Here is the jsfiddle: http://jsfiddle.net/swqZL/ CSS for element div with class "figure": .figure { height: 400px; width: 200px; background-color: black; border-bottom-left-radius: 100%30px; border-bottom-right-radius: 100%30px; } Horizontal radius 100%, vertical radius 30px 回答2: <div style="background: black;

How to round the corners of a button

耗尽温柔 提交于 2019-11-26 23:50:34
问题 I have a rectangle image (jpg) and want to use it to fill the background of a button with rounded corner in xcode. I wrote the following: UIButton *button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; CGRect frame = CGRectMake(x, y, cardWidth, cardHeight); button.frame = frame; [button setBackgroundImage:backImage forState:UIControlStateNormal]; However, the button I get with that approach doesn't have its corners rounded: it is instead a plain rectangle that looks exactly

IOS: create a UIImage or UIImageView with rounded corners

丶灬走出姿态 提交于 2019-11-26 23:47:37
问题 Is it possible create an UIImage or an UIImageView with rounded corners? Because I want take an UIImage and show it inside an UIImageView , but I don't know how to do it. 回答1: Yes, it is possible. Import the QuartzCore ( #import <QuartzCore/QuartzCore.h> ) header and play with the layer property of the UIImageView . yourImageView.layer.cornerRadius = yourRadius; yourImageView.clipsToBounds = YES; See the CALayer class reference for more info. 回答2: Try this Code For Round Image Import

Bitmap in ImageView with rounded corners

白昼怎懂夜的黑 提交于 2019-11-26 22:35:08
问题 I have an ImageView and I want to make it with rounded corners . I use this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@null"/> <stroke android:width="1dp" android:color="#ff000000"/> <corners android:radius="62px"/> </shape> And set this code as background of my imageview. It works, but the src image that I put on the ImageView is going out of the borders and doesn't adapt itself