shapes

Offset shape within a ShapeDrawable

瘦欲@ 提交于 2019-12-03 12:10:53
I'm trying to draw a rounded rectangle with a border around it using a class that extends ShapeDrawable (see here ) and everything is working except that the shapedrawable seems to be cutting off some of the border because the shape itself doesn't extend outside those bounds. Is there not some way to offset where the shapedrawable starts drawing so that there is some padding between the bounds of the shape itself and the canvas? I have tried both ShapeDrawable.setBounds to larger than the intrinsic size of the shape and ShapeDrawable.setPadding but don't seem to be getting anywhere. Should I

Create a bell shape with CSS

我的未来我决定 提交于 2019-12-03 09:47:31
问题 I am playing with shapes in css and want to make a traditional bell shape (think Christmas bell). Here's the general shape that I'm going for (though I really don't care about the balls on the top and bottom): Here's what I have so far: http://jsfiddle.net/bhlaird/NeBtU/ #bell { left:300px; position: relative; } #bell:before, #bell:after { position: absolute; content: ""; left: 50px; top: 0; width: 180px; height:400px; background: #d3d3d3; border-radius: 150px 150px 150px 20px; -webkit

Interesting CSS shape navigation (chevrons)

白昼怎懂夜的黑 提交于 2019-12-03 09:13:29
I'm building a fairly interestingly shaped navigation for a site at the moment. The shape each menu item needs to be is illustrated below: The final nav will look like an extended version of this: I thought it would be an interesting experiment to do these shapes in CSS. The CSS and HTML for one of the arrow shapes is here: .arrowEndOn { font-size: 10px; line-height: 0%; width: 0px; border-top: 11px solid #FFFFFF; border-bottom: 11px solid #FFFFFF; border-left: 5px solid transparent; border-right: 5px solid #FFFFFF; float: left; cursor: pointer; } .arrowBulkOn { height: 20px; background:

Animate a bezier path drawn in drawRect() Swift

一曲冷凌霜 提交于 2019-12-03 06:51:17
问题 I have this shape that i draw in drawRect() var rectanglePath = UIBezierPath() override func drawRect(rect: CGRect) { rectanglePath = UIBezierPath(rect: self.bounds) rectanglePath.fillWithBlendMode(kCGBlendModeMultiply, alpha: 0.7) layer.shouldRasterize = true } When prepareForEditing function is called, i want to animate the rectanglePath. I tried func prepareForEditing(editing:Bool){ UIView.animateWithDuration(0.5, animations: { self.rectanglePath = makeNewShape() } ) } Nothing happens. Can

Create a bell shape with CSS

别来无恙 提交于 2019-12-03 00:17:41
I am playing with shapes in css and want to make a traditional bell shape (think Christmas bell). Here's the general shape that I'm going for (though I really don't care about the balls on the top and bottom): Here's what I have so far: http://jsfiddle.net/bhlaird/NeBtU/ #bell { left:300px; position: relative; } #bell:before, #bell:after { position: absolute; content: ""; left: 50px; top: 0; width: 180px; height:400px; background: #d3d3d3; border-radius: 150px 150px 150px 20px; -webkit-transform: rotate(15deg); -webkit-transform-origin: 0 0; } #bell:after { left: 0; -webkit-transform: rotate(

C# show scrollbars if shape height is greater than form height

廉价感情. 提交于 2019-12-02 22:07:52
问题 I just need to show scrollbars on forms if my shape height is greater than the form height. That way, when the user scrolls down, it can show the end of the shape. This is my code: public partial class Form1: Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void Form1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawLine(new Pen(Color.Black, 2), 100, 50, 100, 1000); //if line height > form height then show scroll bars } }

excel Copy shapes from one worksheet to another

余生长醉 提交于 2019-12-02 14:10:10
问题 I am trying to use a macro to copy all the shapes (images) from a worksheet to another. I used the record macro to do it, but it always gives an aleatory name to the shape making it impossible to reproduce it when we don't know the name of shapes. 回答1: This will copy all the shapes from Sheet1 to Sheet2 : Sub CopyShape() Dim s As Shape For Each s In Sheets("Sheet1").Shapes s.Copy Sheets("Sheet2").Paste Next s End Sub Once the copy is complete, you can position them as you like or rename them

Rounded corner for textview in android

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 13:51:44
I have a textview and want its corner to be in round shape. I already know it can be done using android:background="@drawable/somefile" . In my case, this tag is already included so cannot use again. e.g android:background="@drawable/mydialogbox" is already there to create image in background <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="top" android:background="@drawable/mydialogbox" android:orientation="horizontal" > <TextView android:id="@+id/textview_name" android

Programmatically rotate shapes using coordinates

99封情书 提交于 2019-12-02 09:36:15
问题 If I have some shapes defined using arrays of coordinates e.g. [[-30, -30], [-30, 30], [30, 30], [30, -30]] and edges defined using: [[0,1],[0,3],[1,2],[2,3]] to make a square. How do I programmatically tell the shape to rotate *at the center against an angle of 0->359 in javascript? *Or better yet, is there a function which allows me to choose the center of rotation? ** Currently, I've managed to get the shape to circle the canvas using : var x_rotate = Math.sin(angle * Math.PI /180); var y

Sensing hover over outer edge of a Path2D circle in JPanel [duplicate]

假如想象 提交于 2019-12-02 07:42:26
This question already has an answer here: Collision detection with complex shapes 1 answer So, I have a program that draws Path2D circles onto JPanel. What I am trying to do is resize the circle when the user clicks and drags the bottom right of the circle. So, what I want is to detect when they are on the bottom-right outer edge of the circle, not the bottom-right of the bounds around the circle . Basically, I need to figure out how to do something like this: I know how to do this with rectangles using getBounds() but when you use getBounds() on a circle, it will return the square around the