Comments (5)
Yeah, if the canvas is not redrawn, then when dragging on premade shapes there will be an issue with multiple items being drawn instead of the dragged original. But when redrawing the canvas we need to redraw the image or the starting background.
The flicker occurs because of the loadImage method which is not synchronous, and I also found a problem where I'm not caching the downloaded image which results in a performance issue.
The new released version 2.0.3 should have this problem fixed where the image will not be downloaded again until it is changed and the canvas will only be redrawn with the new image and will not be cleared so the flicker won't occur.
Please check if the changes suit your issue, or maybe we need to do something else.
Best,
Stefan
from ng2-canvas-whiteboard.
Hi @sjucker,
Maybe this could be of some help to you.
When you save the image and get the url (maybe store it somewhere), if you want to draw on it you can try and set the imageUrl?: string
as the canvas whiteboard input, and the content will be redrawn with that same image (there will be no draw history I think).
Please try it out and tell me how it works, if It's something you don't want we can probably work out some alternative and upgrade the canvas for that particular use case.
Cheers,
Stefan
from ng2-canvas-whiteboard.
Hi @Peshou
Thanks for your input.
We tried to set the imageUrl:
<canvas-whiteboard #canvasWhiteboard
[imageUrl]="'data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'"
[drawButtonEnabled]="false"
[clearButtonEnabled]="false"
[undoButtonEnabled]="false"
[redoButtonEnabled]="false"
[saveDataButtonEnabled]="false"
[showShapeSelector]="true">
</canvas-whiteboard>
The image is shown in the background, however when the user draws something on the canvas, the startingColor
is also drawn, resulting in flickering between backgound image and startingColor. Could you please take a look as to why this is the case?
Thank you.
from ng2-canvas-whiteboard.
Tested with version 2.0.3: flickering is gone. Thank you for the quick fix!
from ng2-canvas-whiteboard.
No problem man,
Sorry for the inconvenience.
I will close the issue now and we can open a new one if a problem occurs
from ng2-canvas-whiteboard.
Related Issues (20)
- Not working in Angular 9 HOT 2
- Border-left invisible on Chrome when navigator fullscreen
- the drawn lines move a bit (+/-2px) when mouse click is released, is it intended ?
- Change stroke and fill texts HOT 2
- Cannot find name 'CanvasWhiteboardOptions'. HOT 1
- cannot upload any image to the whiteboard HOT 2
- Error While using the this.canvasWhiteboardService.drawCanvas(update) method from the package HOT 5
- Options to remove Fill and shapes HOT 4
- Clear canvas from another funciton
- Allow Ploygon Shape in Canvas
- ERROR TypeError: this.x.toFixed is not a function at CanvasWhiteboardUpdate.stringify (ng2-canvas-whiteboard.js:61) HOT 1
- Hi, how do i stop the pulsating on the draw button? And can i use an icon instead for the button HOT 5
- Option to import and edit the saved canvas
- (FIX FOR ERROR TypeError: this.x.toFixed) Saving and Reloading without edit Doubles the length of the updates array HOT 1
- how can we add text canvas and formatting(bold,underline,resize). HOT 1
- Example code for WebRTC
- capture the image as you draw HOT 1
- Fill Stroke Clear Button Panel Issue
- Low image resolution HOT 1
- Unable to move freehand drawing and Needed an Text editor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-canvas-whiteboard.