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
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..
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
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
Is it possible alter a portion of a the canvas' alpha to change its opacity?
I am working on speedometer app using GPS and having problem with the view class of the App.All the properties using in the app aligning to the center except the needle..
The class is extending the view and the code i am using in onDraw method is....
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(speedo_meter, (canvas.getWidth() / 2)- speedo_meter.getWidth() / 2,
(can
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.
hi I am trying to get a canvas image and get the base64 and save it.
I learned a lot of information from this forum and will definitely use/visit it regularly. My profession is canvas photography. And I do job on tocanvas.net. I like to create photo to canvas. If any body in this forum interested in canvas print let me know.