Ask or search something about android

Putting a drawing on a canvas inside a layout View or ImageView


Tuesday 13th of April 2010 / talkandroid.com
I have a canvas which I've drawn on (using 'onDraw'), and now I'd like it to appear inside a container in a layout. How do I do that? I've tried making a class that extends a View object and I can get it to draw on the entire screen, but I don't know how to get it to draw just inside the ImageView container in my layout (or even a regular view). I've also tried creating a new Canvas and drawing on it, but I don't know how to get it in the container. Is it even possible?I'm new to android programming so any help would be greatly appreciated.
posted on:
read more

Doodle on your Pixel's touchscreen with this simple drawing app


Wednesday 17th of April 2013 / androidcentral.com
The Touch Drawing App puts the touchscreen on your Pixel to useGoogler and Chromium EvangelistFrançois Beaufort has released a little Chrome app that gives you a chance to put your touchscreen to work. Aptly named Touch Drawing App, all it does is present a canvas which you can draw on with your finger or a stylus.Yes, it's pretty basic, and not something that will make folks rush out and spend $1300 on a Chromebook Pixel. But we have to start somewhere if we want great touch-based apps in Chrome, right? Besides, it's fun and free -- what's not to like.If you have a Pixel, or any touchscreen laptop with the Chrome browser installed, you can grab it at the Chrome Web Store right here.Via: +François Beaufort
posted on: Applications
read more

Drawing on a Canvas


Friday 27th of May 2011 / talkandroid.com
I am writing a wallpaper that is drawing everything on a canvas and it makes the most sense to have a draw function for each of my objects that need to get drawn and pass the canvas to each one. For example something like...Code:public void draw(Canvas canvas, Paint paint) {canvas.drawPath(path, paint);}While this is working for some reason when I do it this way the path is not antialiased nor does the alpha layer affect it.It seems that when the canvas instance is passed to another function it acts as a different layer or something because if I change the drawing method to Code:public void draw(Canvas canvas, Paint paint) {canvas.setColor(0xFF000000);canvas.drawPath(path, paint);}then the path is anti-aliased and I can get transparency, however only the last object drawn is shown because the setColor blocks everything.I am calling setColor before each of the objects draw function in the master draw function but that doesn't work.The work around I have right now is having each object return its path to be drawn by the master draw function but that is really messy and I would like t
posted on: Applications
read more

Draw on SurfaceView(VideoPlayer) Canvas


Wednesday 03rd of November 2010 / talkandroid.com
Hi, I'm trying to draw some primitives on SurfaceView Canvas, but I can't do this. I need to implement a VideoPlayer(SurfaceView) with ability to draw on it(and save user's drawing in future). Can I do this anyhow? Is it possible on Android?There is my code (only drawing on player):Code:package com.example.canvasdrawing;import java.io.IOException;import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Path;import android.media.MediaPlayer;import android.os.Bundle;import android.util.Log;import android.view.Gravity;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.widget.Button;import android.widget.VideoView;public class CanvasDrawing extends Activity {private ArrayList<Path> _graphics = new ArrayList<Path>();private Paint mPaint;MediaPlayer mp = new MediaPlayer();@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setCo
posted on: Applications
read more

Canvas, Aspect Ratio, and Resolution Independence


Monday 26th of July 2010 / androidforums.com
I've stumbled into an interesting issue dealing with drawing images to a canvas (SurfaceView to be precise). I'm working on a simple game, and I'd like to have it play well with a variety of aspect ratios and resolutions. Hence, I've constructed the base background in a smaller aspect ratio so that I can simply add "bars" (blank space areas) to make it fit longer screens. While this solution is fine with me (unless a better one exists which I am unaware of), Things get more difficult when I want to add these "bars" (blank space to pad the sides of the centered background). First off, to get the background bitmap centered, I'm trying to go about by getting the screen measurements and working out the difference between the scaled image and the screen. This seems inelegant, however. Likewise, it opens up a whole new can of worms. From this point, I need to treat all coordinates (such as those used fro drawing units in the game) relative to the image and NOT the screen. Even if I figure out this data in pixels, it still lacks the resolution independence that dips have
posted on: Applications
read more

Infinite Painter: A comprehensive art and drawing tool - Android Authority


Saturday 21st of April 2012 / androidauthority.com
Lugging around sketchpads and tons of art materials used to be such a pain. Nowadays, art can be done digitally. With the convenience of art programs for computers, and the steady development of technology, it didn’t take long until being able to create pieces of art became possible from the convenience of a mobile device.Whether you’re passing the time, trying to put an idea down on paper, or simply having fun, there’s an app that artists everywhere are sure to love. Artists, meet your new best friend that you can carry around on your Android device.Infinite Painter, developed by Sean Brakefield, is an Android app designed to give you a more realistic painting experience. Whether or not you’re a pro in painting, you’ll definitely enjoy working with Infinite Painter. It’s loaded with several features that could mimic actual painting on a canvas.FeaturesInfinite Painter packs a lot of features that will surely come in handy to you. When you are drawing or painting, the type of brush that you use is important. This app has several brushes which are c
posted on: Apps
read more

pass canvas to thread


Tuesday 14th of May 2013 / androidforums.com
HelloI am working on a simple game, and decided to use a new thread to handle a separate part of the game. Once the onCreate method is called, it simply sets the view to the Draw class.My programs has to following:Draw ---> Extends View, the class that draws everythingChar ---> The player, take input do something with it, DOESN'T extend viewSprite ---> Class to loop through bunch of pictures to create an "animation", Char has a list of sprites.Ranged --> This class will be a thread and part of Char. I would like this class to handle its own animation, it has its own variable for sprite.I am trying to get the Ranged class to draw its own animation on the Canvas when i call the Ranged.start (after creating a new thread of this class) method in the Char.The problem is i cannot pass in the canvas, it crashes. If i declare public canvas and try drawing to it, it crashes. How can i draw on the same canvas as the Char class in a completely different thread.
posted on: Apps
read more

Google Maps displays grey tiles when drawing geopoints


Friday 20th of July 2012 / androidforums.com
I'm trying to create an app to plot our mountain bike trails on a Google map. I've got the Google map part working. However, once I try to plot a couple of geopoints and connect them it does displays the geopoints and connects them, but the Google map stops displaying. Only grey tiles show. Here is my code before I plot the points which works. import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Paint.Style;import android.graphics.Point;import android.os.Bundle;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;import com.google.android.maps.Projection;public class DPHTmaps extends MapActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapController mMapController; MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); mMapController = mapView.getController(); mMapController.setZoom(18)
posted on: Android Applications
read more

How to Draw TextView on Canvas in android..?


Wednesday 09th of March 2011 / android.net
How to Draw TextView on Canvas in android..? we have Canvas.DrawBitmap(), Canvas.drawText(), Do we have any Method in Canvas which take TextView as a parameter.. or any other method to display TextView on Canvas. Actually i have a alphabet in TextView and i have to make drawing on that alphabet which is in canvas. Please suggest anything....Thanks for your cooperation
posted on: Beginning Developers
read more

Released my first app..


Thursday 28th of October 2010 / droidforums.net
Hi Guys,I'm new to android development so I thought that I would try making a drawing program to test the waters. People on this forum seem to be a knowledgeable bunch so I thought I should ask for your opinion on how it came out. Its called scribble and this is the market link http://market.android.com/details?id=com.nj.ScribbleI thought that using the MotionEvent.getPressure() would be neat so drawing on the canvas is pressure sensitive. I did all the dev work on my droid X so I would be interested to know if anyone has interesting experiences with the touch sensitivity being different between devices. I will appreciate any feedback, positive or negative.
posted on: App Announcements
read more
androidbeing.com 2013