I'm trying to rotate view with google map v2
I used some small lib which work fine with google map v1
the problem is that rotation does not have an effect.
code snippet:
@Override
protected void dispatchDraw(Canvas canvas) {
canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.rotate(-mHeading, getWidth() * 0.5f, getHeight() * 0.5f);
mCanvas.delegate = canvas;
super.dispatchDraw(mCanva
I found two ways of creating a Bitmap from a view. But once I do that, the view disappears and I can't use it anymore. How can I redraw the view after generating my bitmap?
I am learning on canvas and bitmap with paths and currently working on a drawing app where user can draw paths freely on the extended view.
The app also allow allowing user to import bitmap as the background and draw on it.
Code:
@Override
public void onDraw(Canvas canvas) {
int myColor = 0;
p.setColor(Color.TRANSPARENT);
canvas.drawRect(0, 0, width, height, p);
if (currentPicture != null) {
p.setColor(Color.RED);
canvas.drawRect(0, 0, width, 200, p);
canvas.drawBitmap(currentPicture, new Rect(0, 0, width, height), new Rect(0, 0, width, height), p);
canvas.translate(tr
I am writing android app where I have a canvas that can be zoomed in or out and translated in any direction. Now what I need to know is what is the position of user finger ON CANVAS, not on screen. The problem is that I have to write this app with API 9 compatibility.
What I have achieved is that without scaling everything works well.
Is it possible alter a portion of a the canvas' alpha to change its opacity?
ive been trying to change the color of specific rects in an array of rects when i thouch the screen but it doesnt seem to be working, heres my code:
public Paint blue = new Paint();
RandomColorGen rc;
ArrayList<Integer> colors = RandomColorGen.ColorList(5);
Random rand = new Random();
int columns = 50;
int rows = 50;
Rect square[][] = new Rect[rows][columns];
public boolean isTouched;
publ
I try to write on the canvas by th soft keyboard in android
my ask is how can to show soft keyboard and handle event it on the canvas
my code is
public class DrawView extends View {
Paint paint = new Paint();
private static final String LOGID = "MxView";
String message = "No key pressed yet.";
DrawView(Context context) {
super(co
So I have a canvas that I draw a bitmap onto.. When the scalefactor of the canvas is 1.0f everything works perfectly how I want it to.. However the problem is when I change the scale of the canvas. Either zoomed in or out I run into problems with the coordinates and finding the bitmap so I can move it on touch..
I've tried dividing coordinates by the scalefactor.. multiplying..