demoadda.com

300,000+ members

our android apps in store

demoAdda.com is a community of 3.00 lakh programmers and students, just like you, helping each other. Join them; it only takes a minute: Sign Up

Free Download Canvasview (Draw in canvas) Demo in Android.


15 Reviews
4.5

7

1


Android development tutorial with demos and sample codes. Here you can download Android demo code for your projects and tutorial helpful for learning Android development. Canvasview (Draw in canvas)demo with simple code example development in Android. Download Canvasview (Draw in canvas) source code with screen shot and video tutorials. Android Example Source Code. Android tutorial for beginners youtube video. Android sample basic example tutorial for learning beginners and experiences developer.


Demo Category


Android

Download

Asp .net

Download

C# .net

Download

IPhone

Download

Java Servlet

Download

Javascript jquery

Download

Python

Download

Vb .net

Download

implement Canvasview (Draw in canvas) in Android programmatically.

Simple Canvasview (Draw in canvas) example with screen shots. android , demo , canvas , canvasview , drawimage in canvas , draw circle in canvas , set background . Canvasview (Draw in canvas) this demo development by kishan.




My Favorites Demo

1 favorited



Canvasview (Draw in canvas) demo overviews.


Title : Canvasview (Draw in canvas)
Submit by : kishan
Programming Language : Android
Posting Date : 2015-04-09 06:12:28
Demo Type : mobile
Demo Tag : android , demo , canvas , canvasview , drawimage in canvas , draw circle in canvas , set background
Viewed : 1567
No of download : 7

submit your project source code ...

Download Demo Here (2.8602MB)

share your demo click to upload your code



Canvasview (Draw in canvas) Demo Description.

Here is the demo for canvas drawing in android you can do this following things by canvas. 

API

Undo / Redo / Clear

this.canvas.undo();   // Undo
this.canvas.redo();   // Redo
this.canvas.clear();  // Clear canvas

Mode

The application that use this library has 3 states.

// Setter
this.canvas.setMode(CanvasView.Mode.DRAW);    // for drawing
this.canvas.setMode(CanvasView.Mode.TEXT);    // for drawing Text
this.canvas.setMode(CanvasView.Mode.ERASER);  // for using Eraser

// Getter
CanvasView.Mode mode = this.canvas.getMode();

Drawer

This libarary enable to draw Figures.

// Setter
this.canvas.setDrawer(CanvasView.Drawer.PEN);               // Use Pen Tool
this.canvas.setDrawer(CanvasView.Drawer.LINE);              // Draw Line
this.canvas.setDrawer(CanvasView.Drawer.RECTANGLE);         // Draw Rectangle
this.canvas.setDrawer(CanvasView.Drawer.CIRCLE);            // Draw Circle
this.canvas.setDrawer(CanvasView.Drawer.ELLIPSE);           // Draw Ellipse (Oval)
this.canvas.setDrawer(CanvasView.Drawer.QUADRATIC_BEZIER);  // Draw Quadratic Bezier

// Getter
CanvasView.Drawer drawer = this.canvas.getDrawer();

Background color

// Setter
this.canvas.setBaseColor(Color.WHITE);

// Getter
int backgroundColor = this.canvas.getBaseColor();

Stroke Style

// Setter
this.canvas.setPaintStyle(Paint.Style.STROKE);
this.canvas.setPaintStyle(Paint.Style.FILL);
this.canvas.setPaintStyle(Paint.Style.FILL_AND_STROKE);

// Getter
Paint.Style strokeStyle = this.canvas.getPaintStyle();

Stroke Color

// Setter
this.canvas.setPaintStrokeColor(Color.RED);

// Getter
int color = this.canvas.getPaintStrokeColor();

Stroke Width

// Setter
this.canvas.setPaintStrokeWidth(2F);

// Getter
float strokeWidth = this.canvas.getPaintStrokeWidth();

Alpha (Opacity)

// Setter
this.canvas.setOpacity(128);  // between 0 and 255

// Getter
int opacity = this.canvas.getOpacity();

Blur

// Setter
this.canvas.setBlur(5F);  // greater than or equal to 0

// Getter 
float blur = this.canvas.getBlur();

Line Cap

// Setter
this.canvas.setLineCap(Paint.Cap.BUTT);
this.canvas.setLineCap(Paint.Cap.ROUND);
this.canvas.setLineCap(Paint.Cap.SQUARE);

// Getter
Paint.Cap lineCap = this.canvas.getLineCap();

Draw Text

// Change Mode
this.canvas.setMode(CanvasView.Mode.TEXT);

// Setter
this.canvas.setText("Canvas View");

// Getter
String text = this.canvas.getText();

Font Family / Font Size

// Setter
this.canvas.setFontFamily(Typeface.DEFAULT);
this.canvas.setFontFamily(Typeface.DEFAULT_BOLD);
this.canvas.setFontFamily(Typeface.SANS_SERIF);
this.canvas.setFontFamily(Typeface.SERIF);
this.canvas.setFontFamily(Typeface.MONOSPACE);
this.canvas.setFontSize(24F);  // greater than or equal to 0

// Getter
Typeface fontFamily = this.canvas.getFontFamily();
float fontSize      = this.canvas.getFontSize();

Get Canvas as Bitmap

If application requires to save current canvas as Bitmap, the following methods enable to save.

Bitmap bitmap = this.canvas.getBitmap();

In the case of adjusting size,

Bitmap bitmap = this.canvas.getScaleBitmap(300, 200);  // 300 x 200

In the case of using byte array of bitmap,

// The 1st argument is format.
// The 2nd argument is quality.
byte[] bytes = this.canvas.getBitmapAsByteArray(CompressFormat.PNG, 100);

or,

// Format is PNG. Quality is 100.
byte[] bytes = this.canvas.getBitmapAsByteArray();

In the case of using the specific bitmap,

// ....

byte[] bytes = CanvasView.getBitmapAsByteArray(bitmap, CompressFormat.PNG, 100);

Draw Bitmap to Canvas

From Bitmap,

// ....

this.canvas.drawBitmap(bitmap);

, From byte array of bitmap

// ....

this.canvas.drawBitmap(bytes);


Download Latest Android Demo Source Code


Beautiful Android Login and Signup Screens with Material Design in Android

4.5

Everyone loves a beautiful login screen, and since it’s usually the very first impression people have about your app it’s super important to get it right.This article shows you how to create beautiful login and signup screens the right ... view more

ganeshkavhar

Android demo   ganeshkavhar 2020-03-17

Direct Reply From Notification in Android

4.5

HelloThis is the demo tutorial for creating a notification and make a direct reply from the improved notification tray itself.If you have Android N installed on your device, you may have noticed the new way the notifications appear in the notificatio... view more

Android Notification , Reply Notification , Make reply from notification

Android demo   kishan 2019-04-03

Smooth SignatureView in Android

4.5

HelloHere is the demo for making the smooth sign on the Android canvas. Android library for drawing smooth signatures. You can use for implementing in your application for drawing lines on canvas.Features:Customizable pen color and sizeBit map S... view more

Android Custom Signature, Android Sign view , Android Paint on Canvas, How to make a paint app

Android demo   kishan 2019-02-26

Whatsapp like camera for photos and video in Android

4.5

HelloHere is the demo for creating camera view like WhatsApp. If you click on the capture button then it will click photos. If you hold the button then it will record the video. There will be a preview after capturing a video or photo like insta... view more

Android camera tutorial, How to create a whatsapp layout camera, Instagram camera android, Take phot

Android demo   kishan 2019-02-25

YouTube Intro Video Play inside App in Android

4.5

This Demo plays YouTube video inside your app. You can show Intro video of your app directly from YouTube using this demo. Also can play any YouTube videos using this demo.... view more

YouTube Player, VideoPlayer, Video Streaming

Android demo   hardikmaru2001 2017-03-10