ebarellar/LFColoringBook

How to Resize the coloringBookView in given superview same size

Closed this issue · 5 comments

Hi,

First of all thank you so much for a wonderful lib which use in iOS mobile applicaiton and thanks for lots of effort done by you. I having an issue which requirement is. following

There are fixed UIview and i need to use coloringBookView in side that view without using scrollview. here are issue is that i can not assign coloringBookView fit to given superview size and the image for drawing is come up too big.

Is there any way to resize coloringBookView same as given size and use the same feature without scrollview? Can you please help I try lot to change in code but not getting success if you can help me that means a lot for me.

Thank you
Nitin

It's certainly possible, all over the ColoringBookView you see usage of UIScreen.main.scale, it is done because pixel to UIKit point is not one-to-one. You would need to replace usage of UIScreen.main.scale to a custom scale factor.
Remember it's not just "fitting" that needs to be solved, the touch processing would need recalculations too

Instead of doing that, why don't you keep using the scrollview and just set the zoomscales to fit the parent view so it always "Aspect Fit"?

Basically what was discussed here, but you also set the min and max zooms to your needs #3

Your idea is good and i will try to follow it to keep scrollview. Main thing is that my client making an object for drawing image is not fixed size so that looks too much big and small. Do you have any idea which size of image is best fit for this lin.

Another question if you can answer do you have any idea how to use erasher tool with this (Not clear and not endo and redo) its like earsar do we have any thing for that?

Do you have any idea which size of image is best fit for this lin

Not really, I've thought about what the best size might be compared to other coloring book apps. Download a few and export some images and maybe get into an average. I think I remember they had like 1000px max

Another question if you can answer do you have any idea how to use erasher tool with this (Not clear and not endo and redo) its like earsar do we have any thing for that?

There's some approaches, but I'm curious why a clear color wouldn't suit your needs? Considering the drawing engine doesn't supports opacity, I would expect the clear color to act as an eraser

I really thanks for all your answer and your dedication.

One last question. Can you tel me is there any way to set drawing only work inside the object not our side the border like i put round circle object with black border. so user can drwaing fill color inside circle not our side the circle.

Do you have any idea or logic or method which can we use for it.

thank you in advance

I'm afraid I don't understand the requirement