Tui.image-editor: Mosaic and Zoom

Created on 28 Dec 2019  路  8Comments  路  Source: nhn/tui.image-editor

Version

Development Environment

Current Behavior

hello, this is a great imageEditor, i use it in my project, but my boss want Mosaic and Zoom feature, i try but fail. so i want to ask if you have plan to add these feature.

Expected Behavior

Need Discussion inactive

Most helpful comment

would be nice to have two buttons integrated for zoom in/out

All 8 comments

I'm not sure what the mosaic feature is. A little explanation would help you decide.

How about the zoom feature @jinwoo-kim-nhn ? Will the zoom feature on repo's feature list?

How about the zoom feature @jinwoo-kim-nhn ? Will the zoom feature on repo's feature list?

well,you can add this code in 'graphics.js'
but in other tools like crop,you may need to use canvas.setZoom(1) to reset the zoom ratio.
````javascript
_onMouseWheel(fEvent) {
const delta = fEvent.e.deltaY / 1000;
let zoom = this._canvas.getZoom();

    zoom = zoom - delta;
    if (zoom >= 5) {
        zoom = 5;
    }
    if (zoom <= 1) {
        zoom = 1;
    }
    this._canvas.setZoom(zoom);

    this._canvas.calcViewportBoundaries();
    fEvent.e.preventDefault();
    fEvent.e.stopPropagation();
}

````

@cocoroise thanks for the guide code and file.

here is a demo of fabric canvas that demonstrate zoom in zoom out on mousewheel
http://fabricjs.com/fabric-intro-part-5

by combining the hammer.js touch gesture library, you might implement zoom in zoom out on pinch on mobile device
http://hammerjs.github.io/

hope it helps

would be nice to have two buttons integrated for zoom in/out

I created a Fork to address Zoom and Pan issue for myself .

This issue has been automatically marked as inactive because there hasn鈥檛 been much going on it lately. It is going to be closed after 7 days. Thanks!

This issue will be closed due to inactivity. Thanks for your contribution!

Was this page helpful?
0 / 5 - 0 ratings