shape

Android custom shape

南笙酒味 提交于 2019-12-01 09:29:06
I know it is possible to make a shape looking something like this: But I don't know how to start with it. Can I make it as a shape? or do I have to do something else? BR Quintin Balsdon Oh look at that, I was wrong - gradients are not a problem: import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.LinearGradient; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Shader; import android.view.View; public class ButtonShadow extends View { public ButtonShadow(Context

How to draw Shape exclusively inside Canvas

一个人想着一个人 提交于 2019-12-01 07:07:46
问题 I have a Shape inside Canvas, like this: <ScrollViewer> <Border Height="342" Width="470" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="3" BorderBrush="Black"> <Canvas Background="White"> <Rectangle Width="200" Height="200" Canvas.Left="103" Canvas.Top="186" Fill="Red" /> </Canvas> </Border> </ScrollViewer> Even if the Rectangle is a Canvas children it's draw outside Canvas limits, covering Border bottom border. How can I make the Rectangle is draw only inside Canvas

Use css to create a custom arrow shape [duplicate]

前提是你 提交于 2019-12-01 06:40:33
This question already has an answer here: Arrow before and after a box with CSS 1 answer I have a css arrow box overlaying an image slider but I need to make the tail indented and transparent so the image is seen behind it. Need the white portion to be transparent. See attached image and my css below. Thanks. #flag { width: 400px; height: 80px; background: #231f20; position: relative; } #flag:before { content: ""; position: absolute; top: 0; width: 0; height: 0; border-top: 40px solid transparent; border-bottom: 40px solid transparent; border-left: 35px solid white; } #flag:after { content: ""

JavaFX modify polygons

淺唱寂寞╮ 提交于 2019-12-01 06:00:29
问题 Is there a way to modify a polygon in JavaFX? For example if I have a triangle and I press and then drag a point from that triangle, the triangle will modify with the new coordinates of the point. 回答1: Layer some control nodes over the corners of the polygon. Attach appropriate event handlers to the control nodes so that they can be dragged around. Modify the polygon's points as the control node is moved (using change listeners attached to each of the control node's location properties). Here

Use css to create a custom arrow shape [duplicate]

纵饮孤独 提交于 2019-12-01 05:29:49
问题 This question already has an answer here : Arrow before and after a box with CSS (1 answer) Closed 4 years ago . I have a css arrow box overlaying an image slider but I need to make the tail indented and transparent so the image is seen behind it. Need the white portion to be transparent. See attached image and my css below. Thanks. #flag { width: 400px; height: 80px; background: #231f20; position: relative; } #flag:before { content: ""; position: absolute; top: 0; width: 0; height: 0; border

adding a image to layerlist item with shape

时间秒杀一切 提交于 2019-12-01 01:02:09
问题 i have a xml as below i trying to add a image from drawable folder but its not working. <solid android:color="#FFF"/> this is where i need to add image from drawable folder <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FFF"/> <stroke android:width="1dip" android:color="#225786" /> <corners android:radius="10dip"/> <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /> </shape> is there any other way that i can

android canvas draw circles and get touch events

心已入冬 提交于 2019-12-01 00:36:39
i have been trying to make such a demo where i need to draw many(hundreds of) circle shapes on canvas (or any other way if possible) , after drawing the canvas i need to zoom and move it .. and also want to capture the click(touch) event of each shape separately .. so i know i can get canvas touch event and get x and y positions and check which which circle is touched but i have to draw many circles and as well after zooming and moving the circle's x and y pos is changes so plz help me.. Give me any suggestion how to do this..the way to go.. or if any ANDROID MASTER have done some thing like

create shape xml file in drawable folder in android studio

瘦欲@ 提交于 2019-11-30 21:46:25
问题 I am using Android studio 1.2.2 and need to know how to create a new shape file in drawable folder. I have already done the same in Eclipse but unable to do so in the android studio 1.2.2 回答1: follow these steps create a drawable folder in res directory.(if not present) right click on drawable folder> New > Drawable resource file Give your file a name and change the root element to shape . (its selector by default) now you are good to go. 回答2: I was confused by the post from Anirudh when he

Android drawable with background and gradient on the left

谁说我不能喝 提交于 2019-11-30 21:21:24
W would like to have a drawable which has background and gradient on the left that is about 10dp wide. Image of what I would like to achieve: Red gradient on the left Background on the rest How I can achieve that? I've tried layer-list with two shapes but with no luck. Item background: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/background" /> <item android:drawable="@drawable/gradient" /> </layer-list> Background drawable: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android

android canvas draw circles and get touch events

非 Y 不嫁゛ 提交于 2019-11-30 18:06:01
问题 i have been trying to make such a demo where i need to draw many(hundreds of) circle shapes on canvas (or any other way if possible) , after drawing the canvas i need to zoom and move it .. and also want to capture the click(touch) event of each shape separately .. so i know i can get canvas touch event and get x and y positions and check which which circle is touched but i have to draw many circles and as well after zooming and moving the circle's x and y pos is changes so plz help me.. Give