drawing

Easiest way to draw a sequence of points in WPF from code

爱⌒轻易说出口 提交于 2020-01-22 20:39:28
问题 I'd like to create a WPF app that traces the location of the mouse cursor, updating the image in the MouseMove event handler. My original thought was to create a GeometryDrawing and then add paths to that but I'm struggling with how to wire this up in code (though the Xaml for GeometryDrawings seems straightforward). What's the easiest way to wire this stuff up - its just for debugging so I'm not concerned about efficiency. 回答1: What about just using Polyline? Here's the xaml: <Window x:Class

Easiest way to draw a sequence of points in WPF from code

不问归期 提交于 2020-01-22 20:38:17
问题 I'd like to create a WPF app that traces the location of the mouse cursor, updating the image in the MouseMove event handler. My original thought was to create a GeometryDrawing and then add paths to that but I'm struggling with how to wire this up in code (though the Xaml for GeometryDrawings seems straightforward). What's the easiest way to wire this stuff up - its just for debugging so I'm not concerned about efficiency. 回答1: What about just using Polyline? Here's the xaml: <Window x:Class

Erasing after drawing with CGContext

霸气de小男生 提交于 2020-01-22 05:56:08
问题 I'm trying to do a simple drawing app for the iPad where you can draw on a picture, and I'm using CGContext stuff to do it but the way I originally planned on handling erasing was to just draw over stuff with white...except I just realized today that it doesn't work when you're drawing onto another image because then when you "erase" you'll also "erase" the background image as well. Is there any way to support actual erasing? Thanks! 回答1: Display the user's drawing in a layer above the image.

pyqt drawing on an exsiting widget of GUI

随声附和 提交于 2020-01-20 04:17:24
问题 I am new to pyqt. I am doing a program that allows you clicks on the picture and remember the coordinates of points you clicks and draw a stickfigure on a widget of the GUI. My code right now can prompt out a new window to show a polygon with 4 points. However, I hope it can be displayed on the ui file I alreay made by pyqt. The object name for the widget is called widget.I hope someone can help me to modify the code to display the polygon on the gui widget not prompting out a new window.

Convert windows form to a picture

Deadly 提交于 2020-01-19 17:36:26
问题 I looked around and I may have confused google with the keywords. I am looking to implement a support module in my windows forms application where when a user clicks on a button, an email is sent to the support team, with an attachment of a screenshot (form in question) I am looking for something like form.SaveAsImage(path) any thoughts on how this can be implemented or have I missed the obvious .net 3.5 回答1: Try using the Control.DrawToBitmap method and make sure the form has focus when you

having trouble drawing coloured vertices using shader in opengl to draw data read in from COLLADA file

。_饼干妹妹 提交于 2020-01-17 01:55:32
问题 ok so this is the code I use to put the vertex array and buffers onto the graphics card. void Mesh3D::InitializeBuffers(GLuint program) { float largestPos = findLargestPosition(&col->vectorGeometry); std::cout << "largestPos is: "; std::cout << largestPos; std::cout << "\n"; int loc; vaos = new GLuint[nVectorGeometry]; glGenVertexArrays(nVectorGeometry, vaos);//The vertex array object stores the array of vertice indexes used to find the vertex in the buffer vertex buffer object.. vbosPosition

how to make dynamical strokeColor in CAShapeLayer? In Swift

允我心安 提交于 2020-01-16 03:01:49
问题 I use six parameters (as active, inactive, wired, compressed, free and total). I make a class of CAShapeLayer and I made one function in there with help I can draw circle just add parameters. I make CGPath and add it six once in function which draw a circle. I get the 5 layers to UIView . I make timer which update data in one second but it add else 5 layer to UIView . It is wrong way. I want to animate arcs with data and update in one second. when layers become too much device is working

how to make dynamical strokeColor in CAShapeLayer? In Swift

十年热恋 提交于 2020-01-16 03:01:09
问题 I use six parameters (as active, inactive, wired, compressed, free and total). I make a class of CAShapeLayer and I made one function in there with help I can draw circle just add parameters. I make CGPath and add it six once in function which draw a circle. I get the 5 layers to UIView . I make timer which update data in one second but it add else 5 layer to UIView . It is wrong way. I want to animate arcs with data and update in one second. when layers become too much device is working

drawing application for iOS performance issue

a 夏天 提交于 2020-01-15 19:10:54
问题 I'm creating drawing application for iOS. To draw something with a touch I used a code from this tutorial: http://www.raywenderlich.com/18840/how-to-make-a-simple-drawing-app-with-uikit My code that I use for drawing is the following: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = NO; UITouch *touch = [touches anyObject]; lastPoint = [touch locationInView:self.view]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = YES;

Capturing signature very sketchy on touch screen

雨燕双飞 提交于 2020-01-15 07:17:23
问题 I followed a tutorial for capturing signatures in Firemonkey, and made some major modifications (essentially a re-write) to encapsulate it inside of a custom control. I've written plenty controls in VCL, but this is my first for FMX. When using this with a mouse (Windows or OS X), it works perfectly. However, when using a touch screen (iOS), it becomes extremely sketchy. Specifically, it keeps capturing a mouse up event (or in this context, "pen up"). So a straight line becomes actually a