paint

Android: digital signature using Bezier

a 夏天 提交于 2019-12-03 06:56:06
问题 I am trying two draw digital signature using Bezier as show in above image.when i touch and try to draw line then the result is dot line but not getting continuous line. Simple signature done by using simple signature but I want to create more a smooth curve using Bezier with touch pressure. tried with this link SignatureViewDemo.java public class SignatureViewDemo extends View { private int color = Color.BLACK; private Bitmap m_Bitmap; private final Paint m_BorderPaint; private Canvas m

How to draw a path with variable stroke width

蹲街弑〆低调 提交于 2019-12-03 00:42:47
My code is basically from this example ( http://corner.squareup.com/2010/07/smooth-signatures.html ) and Google APIs (FingerPaint) but now I want to use the class VelocityTracker in order to change the stroke width depending on the speed of my finger. I thought I could split a path into smaller parts but I didn't find any examples. There's also this second post ( http://corner.squareup.com/2012/07/smoother-signatures.html ) but I do neither have a specific bezier curve class nor do I collect all the points in an ArrayList so their example for adjusting stroke width is not very helpful. Does

2013, Existing package for drawing (painting, brush, lines) in iOS?

跟風遠走 提交于 2019-12-03 00:39:43
I need to add typical finger drawing to an app. (The usual.... choose colors, erase, thickness - just the usual you see in every app made.) It's hard to believe I have to program this from scratch, in this day and age? It's hard to believe there is not a common solution for this? All I could find is... https://github.com/levinunnink/Smooth-Line-View Review : that is a (beautifully written) example fragment of a few lines of code being how to draw with a path, with a good smooth result. It works perfectly, but it's just for drawing one "path." For example, you can't make a drawing with more

Android how to draw paint in free hand in MapView using overlay?

帅比萌擦擦* 提交于 2019-12-03 00:39:06
In my app Draw paint in free hand on Map view but searching lot of information finally got from rectangle shape draw on mapview but i want in place of rectangle draw free hand like zigzag how to change my code Any help please.. MapOverlay.java public class MapOverlay extends Overlay { private float x1,y1,x2,y2; private GeoPoint p1=null,p2=null; private MapExampleActivity mv = null; private Paint paint = new Paint(); private Path path = new Path(); private boolean isUp = false; //constructor receiving the initial point public MapOverlay(MapExampleActivity mapV,float x,float y){ paint

why can't I draw any stuffs on Frame in java?

走远了吗. 提交于 2019-12-02 23:17:15
问题 Coding is here. I can't create any rectangle or circle inside frame. the object of this project is to create converting celcius 2 Farenheit & Farenheit 2 Celcius. so what I want is, please teach me to how to draw rectangle or oval in side the frame. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Frame; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax

fingerpaint within a horizontalscrollview

夙愿已清 提交于 2019-12-02 22:00:10
问题 I am combining some pieces of code which I have found on stackoverflow and in the android development kit. I want to put the fingerpaint canvas within a lockable horizontalscrollview. However whenever I atempt to draw in a horizontal direction the scrollview scrolls rather than painting on the canvas. It did not have this problem when I had an imageview in the place of the custom view from fingerpaint. I think that perhaps the overriding of the onTouchEvent in both the custom

paintComponent is not being called in JPanel

耗尽温柔 提交于 2019-12-02 21:04:50
问题 I have following code: package hra; import java.awt.Color; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import static javax.swing.JFrame.EXIT_ON_CLOSE; import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class HerniPole extends JPanel implements KeyListener { public int velikostPole; HerniPole(int velikostPole) { this

Android: digital signature using Bezier

随声附和 提交于 2019-12-02 20:35:20
I am trying two draw digital signature using Bezier as show in above image.when i touch and try to draw line then the result is dot line but not getting continuous line. Simple signature done by using simple signature but I want to create more a smooth curve using Bezier with touch pressure. tried with this link SignatureViewDemo.java public class SignatureViewDemo extends View { private int color = Color.BLACK; private Bitmap m_Bitmap; private final Paint m_BorderPaint; private Canvas m_Canvas; private Point m_CropBotRight; private Point m_CropTopLeft; private float m_CurrentX; private float

Bug when drawing rectangles in my Paint Program

。_饼干妹妹 提交于 2019-12-02 19:57:35
问题 public partial class Form1 : Form { Point downPoint , upPoint; List<Shapes> shapes = new List<Shapes>(); public ShapesEnum shapeType; public Form1() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); foreach (var s in shapes) s.Draw(e.Graphics); } protected override void OnMouseDown(MouseEventArgs e) { downPoint = e.Location; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); upPoint = e.Location; CreateShape(); this

How to call a method that uses PaintEventArgs and coordinates variables

非 Y 不嫁゛ 提交于 2019-12-02 18:15:27
问题 I recently started programming in C# obviously and was trying to do a simple WinForms app that takes mouse coordinates and scales a Rectangle according to the coordinates. The issue I am facing is that i dont know how to call a method that uses more arguments (in this case is x, y and PaintEventArgs ). Or I do know, but I don't know what to do with the PaintEvent . Here is the whole code, since its pretty short and rather simple: using System; using System.Drawing; using System.Windows.Forms;