shape

Custom Shape in Silverlight (porting app from WPF)

南楼画角 提交于 2019-12-12 09:31:15
问题 I'm converting a WPF app to Silverlight. The app includes a class which inherits from Shape. It overrides the DefiningGeometry property to return a Path object. However, the Silverlight Shape class doesn't have a DefiningGeometry property. Reading on the internet I've found others with this same problem. The solution seems to involve inheriting from Control directly, and setting the Content property to the path. However, I also want to retain my event handlers (MouseEnter, MouseLeave,

How to get length of path?

旧街凉风 提交于 2019-12-12 05:40:40
问题 I want to know the length of a Path . For example, if I have a straight line I can just compute the length with its start x , y and end x , y values. But it gets quickly very tricky if I use QuadCurves or CubicCurves . Is there any way to get the length or an approximation of the length of a Path ? For example the following path: Path path = new Path(); MoveTo moveTo = new MoveTo(start.getX(), start.getY()); double controlPointX = 50; CubicCurveTo cubicCurveTo = new CubicCurveTo(start.getX()

2D shape in C++ by using the OpenGl library

孤人 提交于 2019-12-12 05:26:19
问题 I am trying to draw a shape in C++ by using the OpenGl library I've written the following code , but all what I achieved is the following shape ): but do I need to use glRotatef to get this shape :? and how can I use it ? this is my code :) #include <Windows.h> #include <GL\glew.h> #include <GL\freeglut.h> #include <iostream> #include <math.h> using namespace std; float angle, radius, xx1, yy1; int main(int argc, char** argv) { void Transform(void); void circle(void); void shape(void); void

How do I plot this? MATLAB

让人想犯罪 __ 提交于 2019-12-12 04:50:04
问题 I have a matrix, X, in which I want to plot it using the kmeans function. What I would like: If row has a value of 1 in column 4 I would like it to be square shaped If the row has a value of 2 in column 4 I would like it + shaped BUT If the row has a value of 0 in column 5 it must be blue and if the row has a vale of 1 in column 5 it must be yellow (You don't need to use these exact colors and shapes, I just want to distinguish these.) I tried this and it did not work: plot(X(idx==2,1),X(idx=

How do I make a button shape a custom Path in WPF?

眉间皱痕 提交于 2019-12-12 04:36:44
问题 I have a button using the ControlTemplate below. <ControlTemplate x:Key="ControlTemplate" TargetType="{x:Type Button}"> <Grid> <Path x:Name="ButtonPath" Fill="{Binding IsSelected, Converter={StaticResource ArrowBackgroundColorConverter}, UpdateSourceTrigger=PropertyChanged}" Data="{Binding Converter={StaticResource ArrowPathSelector}}" Stretch="UniformToFill" Margin="0 0 -35 0"></Path> <TextBlock Grid.Column="0" Grid.Row="0" FontFamily="{StaticResource ApplicationFont}" FontSize="

How to find rectangle shape in this image using python?

匆匆过客 提交于 2019-12-12 04:29:56
问题 enter image description herecan you help me to segment rectangular objects in this image, tried otsu but it is not working because background and forground have same values. is there any other method to do the same. Can somebody please tell me how to find a rectangle object in these images? Images are results of canny edge detection. Actually I want to track these rectangles in a video, if you know how to do it please tell me. OR at least I want to find whether a rectangle is present or not.

Android buttons with shape background or image

一曲冷凌霜 提交于 2019-12-12 04:14:01
问题 I want to create a button in an Android application which will be round with a color of my choosing and a plus sign as its text. Is it better (in terms of space, efficiency etc.) to create an image of the above description and set it as a background image, or it it better to make a shape with a color and add that as a background? 回答1: To do that you can create a circle shape with the help of shape drawable, but the better way to do this is to use the FloatingActionButton which is circular in

Android background with a thin line

旧城冷巷雨未停 提交于 2019-12-12 03:51:57
问题 I would like to create a background for my layouts. What I used still now is: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="@android:color/darker_gray" /> </shape> </item> <item android:bottom="5dp"> <shape android:shape="rectangle"> <solid android:color="@android:color/black" /> </shape> </item> </layer-list> It works nice untill the activity background were black..

Prevent drawing over the same area of a Graphics2D

主宰稳场 提交于 2019-12-12 03:33:34
问题 Language: Java. Hi, I need to prevent drawing over the same location of a Graphics2D more than once. For example, if the user draws using a BasicStroke with a round cap and a width of 10 over a certain area, that same area cannot be drawn on a second time. The reason I want to do this is so that the user can draw (free-hand) translucent colours over an image without drawing over the same stroke (thus increasing the density of the colour and reducing its translucency). I've tried storing the

Setting the pivot point of a JPanel to its center

女生的网名这么多〃 提交于 2019-12-12 03:16:43
问题 I am building a Java application that is going to feature two circles of random sizes that need to be clicked by the user. The time between the click on the first and the second circle is going to be measured. Unfortunately, since I am new to Java so things have been slow for me. Currently I have my application draw circles and measure time between clicks using System.nanoTime() but now I am running into a problem. Because the circles need to be a fixed distance away from eachother I want to