shape

Creating a shadow around a canvas drawn shape?

自作多情 提交于 2019-12-03 02:45:37
What steps are required to create a shape e.g. rectangle with a shadow from scratch using a Canvas? Adding a shadow layer to the paint used to draw the rectangle yielded no success. No need for a Bitmap, just needed to set the layer type to LAYER_TYPE_SOFTWARE the original approach worked. public class TestShapeShadow extends View { Paint paint; public TestShapeShadow(Context context) { super(context); paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setShadowLayer(12, 0, 0, Color.YELLOW); // Important for certain APIs setLayerType(LAYER_TYPE_SOFTWARE, paint); } @Override protected void onDraw

Android shape within a shape

两盒软妹~` 提交于 2019-12-03 02:25:30
I want to have a shape element with a two color border outline. I can do a single color outline using the solid element, but this only allows me to draw a single line. I tried using two stroke elements within my shape, but that didn't work either. Is there a way to either draw a shape within a shape or draw two lines around my shape (which has rounded corners, BTW). Ben I found that the <layer-list> is the best approach. Like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:left="6dp" android:right="6dp"> <shape

使用zrender.js绘制体温单(2)

一世执手 提交于 2019-12-03 01:54:15
今天我们来画折线图 效果图 以下为模拟数据 [{"time":19,"text":"入\n院\n19\n时\n11\n分","position":42,"cellMin":29.0,"cellSplit":0.2,"type":"text","color":"red","shape":null},{"time":22,"text":"手\n术","position":42,"cellMin":29.0,"cellSplit":0.2,"type":"text","color":"red","shape":null},{"time":129,"text":"手\n术","position":42,"cellMin":29.0,"cellSplit":0.2,"type":"text","color":"red","shape":null},{"cellMin":29.0,"cellSplit":0.2,"y":30.0,"type":"baseline","color":"#000","shape":null},{"cellMin":29.0,"cellSplit":0.2,"y":31.0,"type":"baseline","color":"#000","shape":null},{"cellMin":29.0,"cellSplit":0.2,"y":32.0,"type":

CSS apply border to a cloud shape?

夙愿已清 提交于 2019-12-03 01:47:45
I drew a cloud via CSS3 using different div tags I am trying to add a border to the whole shape but I am having trouble since every shape get its own border how can I apply a border to the whole cloud? HTML: <div id="cloud"> <div id="bottom_c"></div> <div id="right_c"></div> <div id="left_c"></div> </div> CSS: * { margin: 0; padding: 0; border: 0; } body{ background-color: #4ca3ff; } #cloud { position: absolute; } #bottom_c { position: relative; top: 200px; left: 500px; width: 350px; height: 150px; background-color: #fff; border-radius: 100px; border: solid 5px black; z-index: 100; } #right_c{

How to change the shape of Floating Action Button (FAB) on android?

て烟熏妆下的殇ゞ 提交于 2019-12-03 01:36:05
In our android app we need to create a floating action button which isn't the default circle but a square with with three rounded corners. The fab looks like in the image below: I managed to create such a form but don't know how to apply it to my fab, or if it's even possible. The xml file for the shape looks like this: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/red" /> <corners android:topLeftRadius="90dp" android:topRightRadius="90dp" android:bottomRightRadius="90dp"/> </shape> I tried to change the form with

How do I add padding to a bitmap and a color in a layer-list

℡╲_俬逩灬. 提交于 2019-12-03 01:19:51
I need to create a drawable with a layer-list such that the background layer is an image and the foreground is a transparent color. I am able to do that. Where I am not succeeding is adding some padding/margin so that at them bottom a piece of the images shows without the colored layer on top of it. Here is my xml. Thanks for helping. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <bitmap android:src="@drawable/img1" /> </item> <item> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=

Android shape background

巧了我就是萌 提交于 2019-12-03 00:55:00
Is it possible to draw a shape in xml, and use a png as the background to that shape? I already have the shape (it's a square with rounded corners), and i would like to put a background to that square. Drup Desai Yes you can use any shape file as background for any view. This sample create rounded background with white color and black border around the shape. Sample : rounded_corner.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android

Shape detection in image using Matlab

穿精又带淫゛_ 提交于 2019-12-02 23:26:13
问题 I have an image with many shapes and I need to write some Matlab code which remove all the shapes except the rectangle.. Does it availabe to do it using only with strel,imclose and bwareaopen? if you think yes i will be very happy to hear your opinion. Image: 回答1: If I understood right from your comment, rectangle may have any size. I think this can be asked only if the other shapes have fixed size since you are asked to use strel, imclose and bwareaopen. To briefly explain, strel function

Error in method oncreat() when using shape android app

天大地大妈咪最大 提交于 2019-12-02 22:59:10
问题 When I try to use the shapes in the design of Android applications, it is an error occurs without any details please help me My XML Code : <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText2" android:background="@drawable/yazeed" android:textSize="15sp" android:textStyle="bold" android:layout_gravity="center_horizontal" android:gravity="center" android:hint="Domain Name: Administrator@contos" /> My Shape : <?xml version="1.0" encoding=

Correct usage of fft2 and fftshift for shape from shading

放肆的年华 提交于 2019-12-02 21:25:54
I am attempting to recreate a classical shape from shading algorithm seen in the Trucco/Verri text "Introductory Techniques for 3d Computer Vision", but I am having a hard time understanding the fft function in matlab. Essentially, I need to use the integrability constraint to get the depth (Z) of an image. I am not sure when to use fftshift or not in this scenario. Here is the code I have so far. Based on http://www.mathworks.com/matlabcentral/newsreader/view_thread/285244 I basically wrapped all my fft2s in fftshifts, but I don't think this is the correct usage. Could someone please explain