shape

How to adjust image for custom imagebutton?

一世执手 提交于 2020-01-07 02:47:17
问题 I created custom triangle button, from code which was given by wonderful user so, here : How to create layout with buttons like on this picture? ( BUTTON THAT HAVE ACTUALLY SHAPE OF TRIANGLE, NOT MASK ) And i came in level, for adjusting design. I tried to make 9-patch img, also with normal, but it looks for inner button like this: And then bump into finding way for adjusting that image into triangle custom button, and found this solution: Android - Image Button Scale But what i got is not

Reduce Dimensons when converting list to array

别等时光非礼了梦想. 提交于 2020-01-06 03:30:58
问题 I want to reduce the dimensions of an array after converting it to a list a = np.array([[1,2],[3,4]]) print a.shape b = np.array([[1],[3,4]]) print b.shape Output: (2, 2) (2,) I want a to have the same shape as b i.e. (2,) 回答1: >>> a = np.array([[1,2],[3,4], None])[:2] >>> a array([[1, 2], [3, 4]], dtype=object) >>> a.shape (2,) Works, though is probably the wrong way to do it (I'm a numpy newb). 回答2: Do you understand what b is? b = np.array([[1],[3,4]]) print(repr(b)) array([[1], [3, 4]],

Draw Ring with shapeRenderer in LibGDX

ぐ巨炮叔叔 提交于 2020-01-05 22:46:43
问题 I want to draw a ring (circle with big border) with the shaperenderer. I tried two different solutions: Solution: draw n-circles, each with 1 pixel width and 1 pixel bigger than the one before. Problem with that: it produces a graphic glitch. (also with different Multisample Anti-Aliasing values) Solution: draw one big filled circle and then draw a smaller one with the backgroundcolor. Problem: I can't realize overlapping ring shapes. Everything else works fine. I can't use a ring texture,

Draw Ring with shapeRenderer in LibGDX

☆樱花仙子☆ 提交于 2020-01-05 22:44:45
问题 I want to draw a ring (circle with big border) with the shaperenderer. I tried two different solutions: Solution: draw n-circles, each with 1 pixel width and 1 pixel bigger than the one before. Problem with that: it produces a graphic glitch. (also with different Multisample Anti-Aliasing values) Solution: draw one big filled circle and then draw a smaller one with the backgroundcolor. Problem: I can't realize overlapping ring shapes. Everything else works fine. I can't use a ring texture,

Java Class Cast Exception java.awt.geom.Path2D.Double

扶醉桌前 提交于 2020-01-05 02:46:32
问题 I've been getting this class cast exception when trying to to implement an AffineTransform. Call to AffineTransform: public Shape moveToAndRotate(double x, double y, double theta) { double cx = getBounds2D().getCenterX(); double cy = getBounds2D().getCenterY(); at.translate(cx, cy); at.translate(x, y); at.rotate(Math.toRadians(theta)); at.translate(-cx, -cy); return at.createTransformedShape(yingYang); } This is resides in a custom shape class (YingYang). public class YingYang implements

Drawing shape programmatically with part corners rounded only

核能气质少年 提交于 2020-01-03 21:04:16
问题 Problem here is to draw this kind of shape in onDraw method. I've tried using Path and CornerPathEffect but the bottom corners need to be sharp, so it was not working solution. 回答1: Problem here is to draw this kind of shape in onDraw method. Modifying the values for your case: Path p = new Path(); Paint paintN = new Paint(); paintN.setAntiAlias(true); paintN.setStyle(Style.FILL_AND_STROKE); paintN.setColor(Color.YELLOW); p.moveTo(40, 60); p.quadTo(40, 40, 60, 40); p.lineTo(180, 40); p.quadTo

when do you use Input shape vs batch_shape in keras?

不想你离开。 提交于 2020-01-03 16:35:29
问题 I don't find API that explains keras Input. When should you use shape attribute vs batch_shape attribute? 回答1: From the Keras source code: Arguments shape: A shape tuple (integer), not including the batch size. For instance, `shape=(32,)` indicates that the expected input will be batches of 32-dimensional vectors. batch_shape: A shape tuple (integer), including the batch size. For instance, `batch_shape=(10, 32)` indicates that the expected input will be batches of 10 32-dimensional vectors.

average numpy array but retain shape

不问归期 提交于 2020-01-03 08:08:10
问题 I have a Numpy 3 axis array whose elements are 3 dimensional. I'd like to average them and return the same shape of the array. The normal average function removes the 3 dimensions and replace it with the average (as expected): a = np.array([[[0.1, 0.2, 0.3], [0.2, 0.3, 0.4]], [[0.4, 0.4, 0.4], [0.7, 0.6, 0.8]]], np.float32) b = np.average(a, axis=2) # b = [[0.2, 0.3], # [0.4, 0.7]] Result required : # b = [[[0.2, 0.2, 0.2], [0.3, 0.3, 0.3]], # [[0.4, 0.4, 0.4], [0.7, 0.7, 0.7]]] Can you do

Android : Layout with Rounded drop shadow

℡╲_俬逩灬. 提交于 2020-01-03 07:39:27
问题 I want shape in the background of the layout like given below picture. I have tried something , Which is given below. borders.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!--Layer 0--> <!--Layer 1--> <!--Layer 2--> <!--Layer 3--> <!--Layer 4 (content background)--> <!-- dropshadow --> <item> <shape> <solid android:color="#10CCCCCC" /> <padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />

Swift 4 add custom rounded shape to UIView [closed]

拟墨画扇 提交于 2020-01-01 22:25:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I found a great design in an apparently rather famous app called Zenly, they use a view on the bottom of the screen to add extra content to the user experience. I need a view very similar to this one. Unfortunately, I have no idea at all how to get exactly this rounded off shape