Giter Site home page Giter Site logo

canvasview's People

Contributors

korilakkuma avatar sidorovroman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canvasview's Issues

Add to Maven

Is it planned to add this library to maven ? It would be very useful and more developers would use it :) Thanks!

Erasing PorterDuffXfermode not working

Eraser not working if alpha 1.0, must do alpha 0.99 or less to make it work...
<com.bla.bla.bla.utils.CanvasView
android:id="@+id/canvas"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:alpha="0.99"/>

Eraser Mode

Hi, Eraser is not done correctly what actually does is just paint with a white color.

canvas.clear will turn base color to white.

I have put
canvas.setBaseColor(Color.TRANSPARENT);
because I have an imageview below canvas, for my simple photo/image doodle editor.
But whenever I call canvas.clear(), the whole screens goes white. And if I using eraser on canvas the below image/photo appears. I figure out that the base color has change to white because of something inside clear void.

So I try removing or replacing paint.setColor(Color.WHITE) to paint.setColor(baseColor) inside clear() void. Testing the base color to regular color(red,blue,etc) will work. But if I put Color.TRANSPARENT will make it clear NOTHING at all.

Can draw or not

I'm making drawing tools these days.
I added a method because I needed a way to set whether I could draw CanvasView.
Leave comments if you think you need someone else.
I'll look at your answers and request a "Pull requests".

how to Draw a hollow rectangle

how to Draw a hollow rectangle

    this.canvas.setMode(CanvasView.Mode.DRAW);    // for drawing
    this.canvas.setBaseColor(Color.BLUE);
    this.canvas.setPaintStyle(Paint.Style.STROKE);
    this.canvas.setPaintStrokeWidth(20F);
    this.canvas.setPaintStrokeColor(Color.RED);
    this.canvas.setDrawer(CanvasView.Drawer.RECTANGLE);         // Draw Rectangle
    this.canvas.setLineCap(Paint.Cap.SQUARE);
    this.canvas.setBlur(5F);

I try this,but no used

Clearing screen makes drawing laggy.

After clearing screen drawing becomes laggy..
Also eraser is not clearing the drawing its changing stoke color to white. It doesn't works on other background color.

Found bug when drawing with rectangle and move

I found a bug when drawing with rectangle and move upside
This bug found in method: onActionMove class CanvasView
You can fix this by:
from
case RECTANGLE :
path.reset();
path.addRect(this.startX, this.startY, x, y, Path.Direction.CCW);
break;

to
case RECTANGLE :
path.reset();
float sX = this.startX;
float sY = this.startY;
float eX = x;
float eY = y;
if(sX > eX){
sX = x;
eX = this.startX;
}
if(sY > eY){
sY = y;
eY = this.startY;
}
path.addRect(sX, sY, eX, eY, Path.Direction.CCW);

Want to change on mode on different button click

Hi Friend,

I hope there is a answer of my Question. I want to change Mode, Drawer, PaintStrokeWidth on button click. Currently I wrote the code

btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { canvas.setMode(CanvasView.Mode.ERASER); } });

but it is not changing the mode to Eraser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.