Coder Social home page Coder Social logo

Comments (7)

Odaym avatar Odaym commented on July 17, 2024

You really need to address Canvas issues and set proper methods for a seamless experience. I don't want to pull out my hair trying to calculate statusbar height and actionbar height and instruct the canvas to start from the top and subtr......

please :)

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

@Odaym what issues are you talking about?

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Finding it impossible to set canvasHeight to the exact with and height of the image that is loaded under it. So that you could only draw within certain bounds. Not posting code because its too much effort now, I'd rather keep trying it.

By the way also config.setShowCanvasBounds never seemed to show any bounds while the bounds were there

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

and this issue that you mentioned above is just what I need to fix what I just mentioned, because I start off with the drawableView centerInParent and then I set the canvas and I see it starts from the top left as a view that has just been added newly, maybe your config is overriding it and setting to 0, 0 instead of the original position that was set in XML.

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Also, try declaring the drawableView in XML with wrap on both width and height, set its background color to white to see it, it takes match parent on both, fills up the whole screen (without adding a config that contains canvas height and width)

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Sorry I am urinating over this comments section. I was wrong about setShowCanvasBounds being shown, they are being shown it's just that the color of the bounds is black... I am still trying things, I just understood that the canvas of this drawableview is being placed on the view at 0,0 when its config is added, that's my problem

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

6421-6421/com.om.atomic D/SIZE﹕ numbers used to set dimens on drawableView and canvas size H 2000 W : 2000

06-03 03:31:40.937 6421-6421/com.om.atomic D/SIZE﹕ Dimens after setting it on canvas : H 2000 W : 2000

06-03 03:31:40.937 6421-6421/com.om.atomic D/SIZE﹕ Dinens after setting it on drawableView : H 2000 W : 2000

same number set for the actual width and height of the drawableView, then setting the canvas of that drawableView to be the same number (so that the canvas would be the exact size of the drawableView) (both of these numbers come from the bitmap that I've loaded initially that I want to now draw over with a drawableView)

When the above happens, the canvas takes a much larger size than the 2000, 2000 and leads to being able to scroll through it because it's that large, so when it comes to obtainBitmap() from the drawableview of course it will fuck up the position of where I drew on it because it was much larger than the image that I want to stick it on

I checked the code and you are using createBitmap when you want to obtainBitmap() of course, and using pixels as measurement. But there is something that you do inside the CanvasDrawer class you have this strange line 32 where you scale the canvas by the scaleFactor:

canvas.scale(scaleFactor, scaleFactor);

So I am trying to figure out how to account for that number when setting the canvas dimensions to be the same as the drawableview, because that's needed in my case to get an accurate picture of both

from drawableview.

Related Issues (20)

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.