drawing

Drawing a rectangle onto a Google Map

試著忘記壹切 提交于 2019-12-13 07:37:26
问题 My plan is to allow user to draw a rectangle onto a map in order to mark an area and later save it. I found a method to do it, but it does nothing. Here is how the code looks so far. public class Map extends MapActivity{ private MapView mvMap; MapController kontrol; float xs, ys, xe, ye; GeoPoint start, end; private Paint paint = new Paint(); private boolean up = false; @Override protected void onCreate(Bundle arg0) { // TODO Auto-generated method stub super.onCreate(arg0); setContentView(R

color overlapping when drawing multiple path

风格不统一 提交于 2019-12-13 07:34:58
问题 ArrayList ArrayList<Pair<Path, Float>> foregroundPaths = new ArrayList<Pair<Path, Float>>(); Paint initilization mPaint = new Paint(); mPaint.setAntiAlias(false); mPaint.setDither(true); mPaint.setColor(0x0FFF0000); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.BEVEL); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(Math.abs(ImageViewTouch.brushSize / getScale())); mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP)); mPaint.setAlpha(0x80);

Rendering Lines as selectable Controls with properties

柔情痞子 提交于 2019-12-13 07:14:56
问题 I need to draw some lines, and they have very significant meaning to the content that will be linked to them. How do I draw/render a Line (that has been drawn using GDI+) as a Control? What I mean by that is, how do I draw a line that has its own properties, etc. For example, if while drawing the line, I will need to assign information to it, making it unique to all the other lines: public void deleteSeletedLineButton_Click(object sender, EventArgs e) { foreach(Line line in panel1.Lines) { if

Translate/Rotate previously drawn rectangle, is this possible?

穿精又带淫゛_ 提交于 2019-12-13 06:37:20
问题 I have a bmp with text, for ease of access the bmp rotates accordingly to the user options. Problem: the text gets inverted whenever the image rotates. (only strict angles, 90, 180, etc) Possible solution: Rotate the text at 180º then use the regular rotation, so that it doesnt get mirrored? I tried this the following way, I create a rectangle around the text and turn it. Rectangle r1 = new Rectangle((int)(ecobdesenho / 10) / 2 + esp - 15, esp - 25, 25, 12); using (Matrix m = new Matrix()) {

NSView leaves artifacts on another NSView when the first is moved across the second

北城以北 提交于 2019-12-13 06:16:13
问题 I have an NSView subclass that can be dragged around in its superview. I move the views by calling NSView's setFrameOrigin and setFrameRotation methods in my mouseDragged event handler. The views are both moved and rotated with each call. I have multiple instances of these views contained by a single superview. The problem I'm having is that, as one view is dragged over another, it leaves artifacts behind on the view it's eclipsing. I recorded a short video of this in action. Unfortunately,

Drawing a Thick, Arched Line in Android

大憨熊 提交于 2019-12-13 05:22:50
问题 Greetings Everyone. I was wondering how would I go about drawing an ached line on a canvas. If I were to continue this line it would make a perfect circle. I've got pie wedges which is close but I just want the outside of the wedge and it needs to be circular. What should I do 回答1: Canvas and the drawArc() function. 来源: https://stackoverflow.com/questions/4200723/drawing-a-thick-arched-line-in-android

Why is Java drawing slow on a new PC? - VSYNC?

纵饮孤独 提交于 2019-12-13 05:18:55
问题 Running a Java drawing benchmark on a new PC (Core i7-4820K 3.7 GHz, Asus P9X79 LE, GeForce GTX 650, Windows 8.1 and Ubuntu 14.04) appeared to run using vsync at around 60 FPS via Windows with Java RTE 1.7.0_65 . Then, on one later occasion, ran at an expected 400+ FPS, based on speeds on other PCs. Now it is back to 60 FPS. CPU utilisation is almost 0% with GPU at <10% on the lightest test. A new graphics driver made no difference. The same class file obtains 400 FPS via Ubuntu with linux

Drawing event draws two object

别说谁变了你拦得住时间么 提交于 2019-12-13 04:46:58
问题 Program has only this code. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click PictureBox1.Image = PictureBox2.Image Dim g As Graphics = Graphics.FromImage(PictureBox1.Image) g.DrawEllipse(New Pen(Color.MediumOrchid, 5), 30, 30, 30, 30) g.Dispose() PictureBox1.Refresh() PictureBox2.Refresh() End Sub Before clicking PictureBox1 is emtpty and PictureBox2 has a white image. After clicked PictureBox1 and PictureBox2 both have ellipse. I think program uses one image

Get historcial points ios

三世轮回 提交于 2019-12-13 04:26:43
问题 Is there any function or algorithm to catch all the points when drawing in iPhone ? Like in Android, where we have gethistoical points. 回答1: Check the methods touchesBegan:withEvent: , touchesMoved:withEvent: , touchesEnded:withEvent: and touchesCancelled:withEvent: to detect movements For example using the method -touchesMoved:withEvent: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint currentPosition = [touch locationInView

auto sliding of Scrollbars

荒凉一梦 提交于 2019-12-13 04:16:55
问题 In my Winforms application, i have a User Control which serves as a 'screen' to draw various 2D shapes. i have set its 'AutoScroll' property to true, and scrollbars works fine when you zoom the screen( i.e. User control) Now, when i select any shape ( like rectangle or circle etc) and move it so that it goes beyond visible part of screen, i want respective scroll bars to auto slide in order to keep that shape on the visible area of screen. do i need to set any other property of scrollbar ??