Search Results

Search found 3 results on 1 pages for 'user329999'.

Page 1/1 | 1 

  • Android drawCircle's are not always 360 degrees

    - by user329999
    When I call drawCircle (ex. canvas.drawCircle(x, y, r, mPaint);) and I use Paint Style STROKE to initialize param #4 mPaint, the result doesn't quite make a full 360 degree (2*PI radian) circle in all cases. Sometimes you get a full circle (as I would expect) and sometimes only an arc. Does someone have an idea what would cause this to happen? I don't know what cases work and which don't (yet). I've noticed the ones that don't work seem to be the larger circles I'm drawing (100.0 radius). Could be size related. I am using floating point for x, y and r. I could try rounding to the nearest int when in the drawing code.

    Read the article

  • Android Scaled Drawing to ImageView

    - by user329999
    Newbie question, so there's probably a simple answer to this problem. I'm drawing some simple shapes using canvas.drawCircle(), canvas.drawLine() etc. I originally copied the code from: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/DrawPoints.html Which extends a View and draws directly to a canvas. It doesn't load a pre-drawn bitmap because I need my application to turn data into a drawing and the user will enter the data. My changes work, but the drawing is too small (or big) and doesn't fill the screen using all the available screen. Ideally I'd rather use something like an ImageView in .XML like so: If that's possible. The documentation seems to imply that I want to set the scaleType as shown in the above .XML which seems like the simple way to do this. If using an ImageView in .XML is a good idea, then I'm lost on how to draw to the ImageView and could use some guidance on doing that task. If that won't work, then I'll need to do some more thinking about how to get my drawing scaled on the screen and basically I'm lazy and would rather have Android do the work for me. Feel free to suggest some other way that's completely different is this is the wrong solution path. :) Thanks.

    Read the article

  • Use XML Layout to contain a simple drawing

    - by user329999
    I would like to create a simple drawing (lines, circles, squares, etc...) but I'm having difficulty figuring out the best way to do this. The drawing would need to be scaled to fit the display since the size is indirectly specified by the user (like in a CAD application). Also, I don't want to take up the entire display, leaving room for some controls (buttons, etc). I would pass the data to describe the drawing. Here's how I imagine it would work. I create an XML layout that contains something that holds the drawing (ImageView, BitmapDrawable, ShapeDrawable, ...??? not sure exactly what). Then in my Activity I would load the main XML and obtain the resource for the control that holds the drawing. I would then draw to a bitmap. Once the bitmap was completed I would load it into the control that is to hold the drawing. Somewhere along this path it would be scaled to fill the entire area allocated for the drawing in the XML layout. I don't know if my approach is the way to do this or what classes to use. I read the http://developer.android.com/guide/topics/graphics/2d-graphics.html documentation, but it's not helping me with an example. The examples I do find leave me with hints, but nothing concrete enough to do what I want, especially when it comes to scaling, using XML and/or having other controls. Also, there seems to be no good documentation on the design of the 2D drawing system in a more conceptual manner, so it makes what I read difficult to put into any useful context. Any hints on what classes would be useful and/or a good example any other reading materials? Thanks

    Read the article

1