shapes

Is it possible to rounded shapes? Shapes such as hexagon, octagon? [closed]

会有一股神秘感。 提交于 2019-12-13 09:44:12
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I've been trying to round the corners of hexagon shapes for a while however I've found that none of my methods work. Do you guys have any suggestions on how it can be done? 回答1: http://jsfiddle.net/9BTTQ/4/ HTML

Exporting designs in apps as vector (XML/svg) file?

你说的曾经没有我的故事 提交于 2019-12-13 09:05:22
问题 My ultimate goal is to export designs created in mobile apps as vector graphics. Say I have a list of points of corners of shapes and the respective color that goes inside each shape and this design is being displayed on a mobile app (iOS and Android because cocos2d-x is being used). Is it possible to convert this information into a vector file (SVG file which is essentially an XML file)? 回答1: SVG contains a path element that stores the lines that make up a shape's path. The d attribute

Is there a general method of drawing 2d objects on a digital screen

自古美人都是妖i 提交于 2019-12-13 08:20:03
问题 Some context, I want to draw 2D objects by defining a set of pixels to change to a color which represents the shape. For example, if I wanted to draw a square I'd define a top left corner say (0,0), and a bottom right corner say (10,10). Then I'd change the color of all the pixels x values 0-10 with y values 0-10. Unfortunately I don't have a solid step by step method to complete this, and am only able to draw squares/rectangles due to how simple they are. Is there a method you can describe,

Flip coordinates when drawing set of rectangles

大憨熊 提交于 2019-12-13 07:29:33
问题 I am trying to draw set of squares but the origin(0,0) of squares was in top left corner initially and I wanted squares to render from bottom right corner, and I found this code to flip the co ordinates, but nothing is rendering on winform. I know that I have gone wrong in Height attribute of TranslateTransform. I dont get as to why Height is required as i am trying to draw a set of 2d squares. I tried hardcoding the height attribute still of no use. public void ScaleTransformFloat

Detecting shapes in a “bitmap”

冷暖自知 提交于 2019-12-13 04:40:47
问题 So,preparing myself for the next ieextreme competition I was going through some past problems.I found one that really troubles me,since I can't figure out what to do.I could probably make it using some bruteforce 300 lines code,but I think that this is not what someone is supposed to do in such competitions,so I need your help!! Detecting shapes in a bitmap Problem statement: In image analysis, it is common to analyze a bitmap and observe the shapes present in it. For this problem, design an

Clip an image to form an oval (centered image)

风格不统一 提交于 2019-12-13 04:26:13
问题 I am trying to clip images into shapes and then draw them on canvas. I am curious how would I clip an image to return it as an oval shape. Would I use something like arc() or bezierCurves() ? 回答1: I believe the most convenient way would be to set the border radius. #hey{ background:red; color:white; padding:5px; border-radius:5px; } <div id="hey">hey</div> If you want to do it with javascript, you should use: document.getElementById("hey").style.borderRadius="5px"; This also works with images

vba: test if shape contains a textframe

爷,独闯天下 提交于 2019-12-13 02:16:24
问题 I want to loop over all shapes in a chart in an excel file. This works in principle with Dim currChart As Chart Set currChart = Sheets("Diagramm 1") Dim sShapes As Shape For Each sShapes In currChart.Shapes Debug.Print sShapes.name Debug.Print sShapes.TextFrame.Characters.Text Next sShapes However, the property TextFrame is not known by all type of shapes. therefore I want to test if a shape has a textframe. How can I do that? 回答1: I assumed that you need to know if there is text within your

Python: how to create a submatrix discretizing a circle?

喜欢而已 提交于 2019-12-13 01:43:32
问题 In a 2D square grid (matrix) full of zeros , I need to create a submatrix full of ones , with the shape of this submatrix being as close as possible to a circle. I know a circle cannot be precisely represented when you work with cells or pixels, therefore I aim at a discretized circle. The best thing I could come up with was this code, which produces square submatrices (the blue square in the image below): from __future__ import division import numpy import matplotlib.pyplot as plt import

Why do my shapes and images disappear on my panel?

老子叫甜甜 提交于 2019-12-12 22:44:30
问题 I have used the paintComponent method to draw shapes on my panel. However, every time I minimize the frame or resize it, they disappear. Not sure what to add to my code. public class ShapePanel extends JPanel implements ActionListener, MouseListener{ int a,b,c,d; Graphics2D g2D; private Rectangle2D rect = new Rectangle2D(a,b,c-a,d-b); public ShapePanel(){ addMouseListener(this); setLayout(new GridLayout()); } public void paintComponent(Graphics g) { g2D = (Graphics2D) g; g2D.draw(rect);

How to draw a section of a circle using System.Windows.Shapes.Path?

那年仲夏 提交于 2019-12-12 15:04:11
问题 I have a Silverlight application where I draw lines on a picture by instantiating an instance of System.Windows.Shapes.Line and then adding it to MainCanvas.Children. I would like to similarly add some circle segments. If I understand correctly, I will want to use the Path class. I have the following requirement. I have (x,y) coordinates for the center of the circle. I have the radius r. I need to draw an arc that is a subset of the circle with center (x,y) and radius r. I have two angles a1