shape

Android rectangle shape with two different color

前提是你 提交于 2019-12-07 15:48:14
问题 how can I create rectangle shape by using two different colors with shadow? like above image. 回答1: Please create a drawable file and put the below code in it. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <size android:height="20dp" /> <solid android:color="#F66D08" /> </shape> </item> <item android:top="50dp"> <shape android:shape="rectangle" > <gradient android:endColor="#AD1B1D"

How to read Shape's properties in Visio

偶尔善良 提交于 2019-12-07 02:08:58
问题 I have the following task. I'm writing an Add-In for Visio 2010 on C# in Studio 2010. Let's say that I have a diagram opened. And I have a shape of any kind in this diagram (let's try to manage one shape for the begining). The question is how can I read any properties of this shape? Which API should I use? Basic algorithm: Scan opened document for shapes If there are any shapes in document, then return an array (or a list) of all shapes (null is returned in case of no shapes in current

Fill Octagon in C#

南楼画角 提交于 2019-12-07 01:12:28
I have created a method that draws an octagon, and it works well, as long as the size is 200 or higher public static void FillOctagon(PaintEventArgs e, Color color, int x, int y, int width, int height) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; var points = new [] { new Point(((x + width) / 2) - (width / 4), y), //side 1 new Point(x, ((y + height) / 2) - (height / 4)), //side 2 new Point(x, ((y + height) / 2) + (height / 4)), //side 3 new Point(((x + width) / 2) - (width / 4), y + height), //side 4 new Point((x + width) - (width / 4), y + height), //side 5 new Point(x + width, ((y +

Using VBA to insert and keep images in file - Excel 2013

为君一笑 提交于 2019-12-06 23:55:32
问题 I'm working on a macro for a friend of mine who needs to import a set of images in an excel document and later use this document on other computers. The problem I encountered is that when opening this document on a different computer, all the images are gone and instead you get these little error signs, indicating that the image path could not be found. I have developed the macro on my own computer where I have Excel 2007 and for me, the code works perfectly fine. My friend uses Excel 2013

size of node with shape=circle

▼魔方 西西 提交于 2019-12-06 16:36:33
问题 i'm trying to set the size of the nodes this way: controller[shape=circle,width=.5,label="Controller",style=filled,fillcolor="#8EC13A"]; But all three nodes are with different size. How can i set fixed size? 回答1: From the DOT Guide http://www.graphviz.org/pdf/dotguide.pdf on page 4 it says the following: When drawn, a node’s actual size is the greater of the requested size and the area needed for its text label, unless fixedsize=true , in which case the width and height values are enforced.

How to set a shape's background in xml?

为君一笑 提交于 2019-12-06 16:30:40
问题 I just created a red circle using android shapes: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadiusRatio="4" android:shape="ring" android:thicknessRatio="9" android:useLevel="false" > <solid android:color="#FF0000" /> <size android:height="48dip" android:width="48dip" /> </shape> This is really cool, but I cannot set the background color of the circle to my color. I tried android:background="#FFFFFF" but it always

How to draw a closed curved shape?

余生颓废 提交于 2019-12-06 15:19:05
问题 How can I draw (with finger) crisp CLOSED shape on Android. I can get the series of points froim touch input and I need to put custom curved shape which corresponds (doesn't have to go exactly through the points) the points. 回答1: Track your touch points and apply them in order to construct a Path (docs link) that can be drawn. Path is set up in such a way that you can append each point to it as they come in, and you can decide what type of connection (line, arc, bezier) to draw in between.

How to change the color of TextView at runtime with shape attribute on Android?

走远了吗. 提交于 2019-12-06 15:14:51
问题 I'm using shape attribute like this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#FFFFFF" /> <corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp" android:topLeftRadius="15dp" android:topRightRadius="15dp" /> </shape> and <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/rounded

Ideas for generating random lobulated pulmonary nodule contours

时光怂恿深爱的人放手 提交于 2019-12-06 14:32:45
I need to generate random lobulated contours such as the following Any ideas or algorithms on how to do this ?? The software I am going to use is matlab, however I have no problem if you post solutions in other languages too... p.s I only need to plot a random contour that resembles the above... How about this? degree = 5; numPoints = 1000; blobWidth = 5; theta = 0:(2*pi)/(numPoints-1):2*pi; coeffs = rand(degree,1); rho = zeros(size(theta)); for i = 1:degree rho = rho + coeffs(i)*sin(i*theta); end phase = rand*2*pi; [x,y] = pol2cart(theta+phase, rho+blobWidth); plot(x,y) axis equal set(gca,

How to draw line between two nodes placed in different Panes / Regions

一笑奈何 提交于 2019-12-06 13:55:30
I am tryin to draw a genealogy tree. In my tree, I store information about ex partners. So the Panel (Region) for person shoud looking like this Z * * * Z * * * Z * * * X --- Y Where Z represent exPartner, X represent Persion and Y represent current Wife / Husband And now I would like to draw line to connect current relation with children. And ec relations with children. (graphicaly there will be a line beetwen Z and *) But when the person is in the other region LayoutX and LayoutX property return relative value. How Can I do that, and how dynamicaly resize this Panel ? I would like that Z