draw

Draw solid color triangle using XAML only

杀马特。学长 韩版系。学妹 提交于 2019-12-31 10:56:30
问题 Is it possible to draw a filled in triangle using XAML only (not a code behind solution)? Triangle should be like on the image below to represent sort direction Ascending/Descending along with a sort button on a chart control: EDIT: The solution, thanks to SpeziFish: Ascending: <Polygon Points="0,0 8,5, 0,10" Stroke="Black" Fill="Black" /> Descending: <Polygon Points="8,0 0,5, 8,10" Stroke="Black" Fill="Black" /> 回答1: <Polygon Points="0,0 80,50, 0,100" Stroke="Black" Fill="Black" /> See API

How to use drawRect to draw in a existing view?

自古美人都是妖i 提交于 2019-12-30 11:26:27
问题 I'm doing a GPS tracking app. Every time it receives a Latitude/Longitude it converts it to (x,y) coordinates and calls drawRect to draw a line between two (x,y) pairs. However, the drawRect method just clear all the old contents before it draw new thing. How I can make the drawRect to draw new thing on the existing canvas? Thanks in advance here is my viewController.h #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @class routetrack; @interface simpleDrawViewController :

How to draw a rectangle in WPF at a specific x,y screen location?

半城伤御伤魂 提交于 2019-12-30 08:20:53
问题 In C#, WPF I've created a rectangle: Rectangle myRgbRectangle = new Rectangle(); myRgbRectangle.Width = 1; myRgbRectangle.Height = 1; SolidColorBrush mySolidColorBrush = new SolidColorBrush(); Yes, I really just want it to be 1 pixel by 1 pixel. And I want to change the color based on the variable height like so: mySolidColorBrush.Color = Color.FromArgb(255, 0, 0, (byte)height); myRgbRectangle.Fill = mySolidColorBrush; Now, how do I draw at a specific x,y location on the screen? I do have a

HTML5 CANVAS draw image

穿精又带淫゛_ 提交于 2019-12-30 03:23:07
问题 Here is my question I kind of not understand what is the sx and sy is for in below function context.drawImage(Image, sx, sy, sw, sh, dx, dy, dw, dh); what I really mean is if we change the values of sx and sy and set our dx and dy to a fix value, let say dx=0 and dy=0, is there really going to make any different to our image on the canvas when we set sx=300 and sy=300 as compared to sx=0 and sy=0? I mean the destination image is still in the location dx=dy=0 even we set sx and sy to different

drawing your own buffered image on frame

ぐ巨炮叔叔 提交于 2019-12-29 09:12:51
问题 I have a buffered image with the sizes of my frame: public BufferedImage img; public static int WIDTH = 800; public static int HEIGHT = 600; img=new BufferedImage(WIDTH, HEIGHT,BufferedImage.TYPE_INT_RGB); How can I draw it so I can see just a black image filling the frame? without using Canvas I want to use only the drawImage function from graphics without using the paint or paintComponent functions If it is possible, how can i assign an 1D array [WIDTH*HEIGHT] to that image? SIMPLY: I want

Draw a circular segment progress in SWIFT

懵懂的女人 提交于 2019-12-29 07:20:24
问题 I would like to create a circular progress with slices where each slice is an arc. I based my code on this answer: Draw segments from a circle or donut But I don't know how to copy it and rotate it 10 times. And I would like to color it following a progress variable (in percent). EDIT: I would like something like this Any help please Regards 回答1: You could use a circular path and set the strokeStart and StrokeEnd. Something like this: let circlePath = UIBezierPath(ovalInRect: CGRect(x: 200, y

Draw text and add to a UIImage iOS 5/6

强颜欢笑 提交于 2019-12-29 05:32:04
问题 I have a textbox, where i want the written text to be added to a UIImage. How can i draw NSString to a UIImage? I´ve searched, and found lots of examples, but non of them works. Xcode just gives me lots of errors. Simply put, i want to draw a NSString to a UIimage. The UIImage should be the same size as a predefined UIImageView, and be placed in center. Any ideas? 回答1: i think solution is here..i have used this method in one of my application here lbltext is the object of my label. this

I want to draw custom shape like apple shape on UIView

我怕爱的太早我们不能终老 提交于 2019-12-28 19:36:43
问题 I am trying to make Apple kind of shape for progressHUD. I have option to use .png Image but I cant because I have to fill the apple Shape with different colour depends of percentage status.. I am using UIView to draw this shape... I want suggestion how to draw apple kind of shape easily? And How we can fill half colour with different colour? 回答1: I have option to use .png Image but I cant Yes, you can. — Get hold of some apple-shaped artwork. Use it as a mask - it punches a hole in a view.

Regarding Android Paint drawing color

假如想象 提交于 2019-12-28 18:16:13
问题 DrawView.java public class DrawView extends View implements OnTouchListener { private Canvas mCanvas; private Path mPath; public Paint mPaint; ArrayList<Path> paths = new ArrayList<Path>(); private ArrayList<Path> undonePaths = new ArrayList<Path>(); private MaskFilter mEmboss; private MaskFilter mBlur; private Bitmap im; public DrawView(Context context) { super(context); setFocusable(true); setFocusableInTouchMode(true); this.setOnTouchListener(this); paths.clear(); undonePaths.clear();

Regarding Android Paint drawing color

坚强是说给别人听的谎言 提交于 2019-12-28 18:14:29
问题 DrawView.java public class DrawView extends View implements OnTouchListener { private Canvas mCanvas; private Path mPath; public Paint mPaint; ArrayList<Path> paths = new ArrayList<Path>(); private ArrayList<Path> undonePaths = new ArrayList<Path>(); private MaskFilter mEmboss; private MaskFilter mBlur; private Bitmap im; public DrawView(Context context) { super(context); setFocusable(true); setFocusableInTouchMode(true); this.setOnTouchListener(this); paths.clear(); undonePaths.clear();