draw

ontouch in android: getting X and Y coordinates and drawing circle on that point

限于喜欢 提交于 2020-01-04 13:44:14
问题 in my application on ontouch of screen i'm getting the coordinates(x.y), after that on that position i'm drawing a circle.but when i'm drawing a circle on that position.it always draw a circle on upper left side corner of images on some pt.s .i'm not getting why this is happening.please help me. public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub if(event.getAction()==MotionEvent.ACTION_UP) { Log.d("position", event.getX() + "-" + event.getY()); System.out

wxPython draw text onto EXISTING bitmap or image

自古美人都是妖i 提交于 2020-01-03 15:35:08
问题 I'm trying to add a background image to some text, I'm hoping to do this by using MemoryDC to write text to an image which will then be placed in my GridSizer. Everything works as I want it to with the exception that I cannot use an existing image to draw text onto, I have to create a new, empty, bitmap which is pointless for me because it puts me back where I started. Here is my code, it places a white box into my GridSizer with text drawn onto it: w, h = 150,64 bmp = wx.EmptyBitmap(w,h) dc

wxPython draw text onto EXISTING bitmap or image

让人想犯罪 __ 提交于 2020-01-03 15:34:06
问题 I'm trying to add a background image to some text, I'm hoping to do this by using MemoryDC to write text to an image which will then be placed in my GridSizer. Everything works as I want it to with the exception that I cannot use an existing image to draw text onto, I have to create a new, empty, bitmap which is pointless for me because it puts me back where I started. Here is my code, it places a white box into my GridSizer with text drawn onto it: w, h = 150,64 bmp = wx.EmptyBitmap(w,h) dc

How to draw images in tkinter window

☆樱花仙子☆ 提交于 2020-01-03 08:41:47
问题 How do I draw an image in a tkinter window (I'm using python 3.3)? I'm looking for a statement which would draw an image at a given position on a tkinter window. yeah... Any answers would be appreciated. And here's the source code of the program (if it can be called that) that I want to use the code in, in case you need it. from tkinter import * class craftClass(): def __init__(self, x = 80, y = 80, xmotion = 0, ymotion = 0, health = 20): self.xPos, self.yPos = x, y self.dx, self.dy = xmotion

Android drawing objects on screen and obtaining geometry data

僤鯓⒐⒋嵵緔 提交于 2020-01-03 01:47:08
问题 Has anybody experience on drawing objects, by vertices e.g. Polygons and obtaining their surface and perimeter. The geometry will be drawn by hand using vertices or coordinates similar to https://play.google.com/store/apps/details?id=de.hms.xconstruction and then shapes formed. I need to obtain the surface of these closed shapes. Is there any available example on the net? Thanks in advance. 回答1: I think the following piece of code could be a good start. It basically draws lines between all

Android drawing objects on screen and obtaining geometry data

荒凉一梦 提交于 2020-01-03 01:46:07
问题 Has anybody experience on drawing objects, by vertices e.g. Polygons and obtaining their surface and perimeter. The geometry will be drawn by hand using vertices or coordinates similar to https://play.google.com/store/apps/details?id=de.hms.xconstruction and then shapes formed. I need to obtain the surface of these closed shapes. Is there any available example on the net? Thanks in advance. 回答1: I think the following piece of code could be a good start. It basically draws lines between all

How can i draw in picturebox a polygon which is marked on the edges

纵然是瞬间 提交于 2020-01-02 11:06:22
问题 i tried in that way but i didnt get the needed results: System.Drawing.Point[] p = new System.Drawing.Point[6]; p[0].X = 0; p[0].Y = 0; p[1].X = 53; p[1].Y = 111; p[2].X = 114; p[2].Y = 86; p[3].X = 34; p[3].Y = 34; p[4].X = 165; p[4].Y = 7; g = PictureBox1.CreateGraphics(); g.DrawPolygon(pen1, p); what i want to do is to draw a polygon in picturebox which is defined with diffrent colors and according to the rates (the number of corner and coordinates of the edges ) 回答1: Create an xOffset

Can I draw on a Form, above all controls?

落花浮王杯 提交于 2020-01-01 09:28:08
问题 Is it possible for me to draw ABOVE all controls on a form ? I have some controls ( textboxes , buttons , COM objects ) on my form, and I wish to draw ON them, overriding any pixels previously drawn by them. I am using Windows Forms on C# . NOTE: the Graphics class draws under the controls... 回答1: Take a look at the code in this article: Draw Over WinForms Controls The author has created a component that (as he describes it) is like a piece of glass over your form. Your code then draws on

Display only the corners of a UIView

久未见 提交于 2020-01-01 03:16:07
问题 How to display only the corners of a UIView? let view = UIView() view.layer.borderColor = UIColor.white.cgColor view.layer.borderWidth = 2 let maskframe = UIView(frame: CGRect(x:0, y:0, width:view.frame.width, height:view.frame.height)) view.layer.mask = maskframe.layer.` This masks only the right edge and i dont understand how it works either. 回答1: Try with this class , here I use a custom view drawing using CoreGraphics , added some Inspectable variables to help with customization // //

Formatting legend and axis in Google Charts

夙愿已清 提交于 2020-01-01 02:35:09
问题 I'm new with Google Charts and I am not able to obtain a fine result with the texts surrounding the graph. This is how my chart looks: As you can see, it does cut both Horizontal-Axis and Legends, so the final result is not as good as It could be. Is there a way to solve this? I've been reading the official documentation and some posts from here, but I haven't found the way to do this. Recap: How do we modify the legend or the axis texts so they are fully visible? 回答1: After some time