drawing

drawing on iphone

旧街凉风 提交于 2019-12-17 19:51:09
问题 I am trying to develop an iPhone application for children which will be able to draw characters on screen with touch and I want to know how to match the character drawn with good character of the alphabet. How will i compare the two shapes (drawing and existing) Any idea?? some code? 回答1: Using GLGestureRecognizer you can create a catalogue and it will compute a metric between an input point array against an "alphabet" you predefine. GLGestureRecognizer is an Objective-C implementation of the

Android rotate bitmap around center without resizing

老子叫甜甜 提交于 2019-12-17 19:47:28
问题 I'm struggling to draw a rotating bitmap around its center and do the rotating without resizing the bitmap. I'm drawing all my sprites to the screen via a game thread, so I'm looking for a solution that incorporates the original bitmap and not the canvas. Thanks in advance. This is my code so far, it turns a bitmap around its center, yet resizes it. i = i + 2; transform.postRotate(i, Assets.scoresScreen_LevelStar.getWidth()/2, Assets.scoresScreen_LevelStar.getHeight()/2); Bitmap resizedBitmap

Drawing with CGPath to SVG output

早过忘川 提交于 2019-12-17 19:38:06
问题 I made an paint (drawing screen) with CGPath and CAShapeLayer and now my client want the output image scalable and i found SVG Kit SVG Kit but i don't know how to use this library. I didn't find and example neither in the library examples ! Does anyone know how to use this library for converting CGPath to SVG or can give me an tutorial for ? Thanks in advance ! 回答1: You could start with looking at this file on GitHub. It has a routine to convert a CGPathRef to the d attribute of an SVG Path.

Canvas.clipPath(Path) not clipping as expected

狂风中的少年 提交于 2019-12-17 18:34:40
问题 I'm trying to clip a canvas drawing operation to an arc-shaped wedge. However, I'm not getting the intended result after setting the clipping path to the canvas. For illustration, here is what I'm doing: path.reset(); //Move to point #1 path.moveTo(rect.centerX(), rect.centerY()); //Per the documentation, this will draw a connecting line from the current //position to the starting position of the arc (at 0 degrees), add the arc //and my current position now lies at #2. path.arcTo(rect, 0, -30

Can I suspend redrawing of a form until I have performed all updates?

隐身守侯 提交于 2019-12-17 18:24:59
问题 Using C# and .Net 2.0, I'm using an irregularly shaped form (TransparencyKey, FormBorderStyle = None, etc...) and want to allow "normal" bordered mode. I change the back colour to default from Lime I change FormBorderStyle to FixedSingle I change the TransparencyKey to Colour.None Unfortuanately this looks a complete mess on screen with the image jumping a few pixels down and to the side and Lime green form. I think this is caused by the form being redrawn after each line of code, is it

google maps API v3 - how to draw dynamic polygons/polylines?

蓝咒 提交于 2019-12-17 17:29:19
问题 I have 4 days of experience with Google Maps Javascript API and i find their documentation and information sharing confusing at best. Does anyone have experience or knowledge on how to draw polygons/polylines on a google map (using Javascript API V3) similar to this example? (which i found on this blogPost from 2008) So far as my research can tell me the example uses the Javascript API V2 directly or uses the GeometryControl utility library from V2 (which can be found here for reference). I

Why my coordinate (1,1) start at (0, 1)?

感情迁移 提交于 2019-12-17 17:13:14
问题 I overriden Border control and in my overriden OnRender I do: protected override void OnRender(System.Windows.Media.DrawingContext dc) { this.SnapsToDevicePixels = true; this.VisualEdgeMode = EdgeMode.Aliased; var myPen = new Pen(new SolidColorBrush(Colors.LightGray), 1); dc.DrawLine(myPen, new Point(1, 1), new Point(1, RenderSize.Height - 1)); return; Which give me this result: Question: Is anybody can tell me why my code draw a line that start at (0,1) while it is suppose to start at (1, 1)

Get positions of views in a dialog, relative to their parent

℡╲_俬逩灬. 提交于 2019-12-17 17:01:05
问题 What I want to do is, to draw a line from the edge of a button to a point on the screen... I'm using a dialog fragment for this... And all functions I tried always return the 0 point... I tried following: @Override protected Dialog createDialog(Bundle savedInstanceState, FragmentActivity activity) { Dialog d = builder.create(); View v = LayoutInflater.from(activity).inflate(R.layout.dialog, null); builder.setView(v); // custom view by my which draws simple lines between points... LineDrawView

OpenGL ES 2.0 Sphere

时光怂恿深爱的人放手 提交于 2019-12-17 16:43:09
问题 What is the easiest way to draw a textured Sphere in OpenGL ES 2.0 with GL_TRIANGLES? I'm especially wondering how to calculate the vertices. 回答1: There are various ways of triangulating spheres. Popular ones, less popular ones, good ones, and not so good ones. Unfortunately the most widely used approach isn't very good. Spherical Coordinates This might be the most widely used approach. You iterate through the two angles in a spherical coordinate system in two nested loops, and generate

JavaFX 2 drawing performance

北战南征 提交于 2019-12-17 16:36:08
问题 I feel that the drawing performance of JavaFX 2 is worse than those of Swing. I think one of the reasons is how you draw things, e.g. when drawing a Line, one has to create a Line object for each line and add it to some container while in Swing one just gets the Graphics2D once and then does drawLine without creating a new object each time. So, is there any more performant way to draw using JavaFX 2, e.g. if you have to draw about 3000 Arcs? What's the best "drawing surface"? Currently I am