devforth / painterro

Painterro - JavaScript painting plugin
MIT License
642 stars 85 forks source link

image Icons and arrows #143

Open Krusty79 opened 3 years ago

Krusty79 commented 3 years ago

Describe the feature It will great to have an ability to add an image Icons for technical drawings and have arrows option for side dimensions

Possible analogs? Gimp, MSPaint, Inkscape, etc...

ivictbor commented 3 years ago

Hi @Krusty79 unfortunately it is not clear at all what do you mean. Please record some videos or post clear screenshots of one of the analogs. Image icon, what is it? For Me sounds like an plain image. So it is already possible. If you mean some kind of left and top roller?

Krusty79 commented 3 years ago

Hello Ivan, Sorry for the incomprehensible problem. Image Icon - I mean it's better to be able to add the images the client wants to use without routing the download. How I did it in a web drawing app (see attached screenshot and video)

There is also a much bigger problem. If you try to edit an image after saving, all previous updates are overwritten on save.

https://user-images.githubusercontent.com/21046382/118472743-de7d1b00-b711-11eb-9b8f-0d5f6e599477.mp4

webpaint

Regards!

ivictbor commented 3 years ago

@Krusty79 Oh, I see now, thanks a lot, I thought about something another. Now it is clear.

About bigger problem, could you post a code?

Krusty79 commented 3 years ago

@Krusty79 Oh, I see now, thanks a lot, I thought about something another. Now it is clear.

About bigger problem, could you post a code? compomemt.html <div *ngIf='quote'> <img (click)="draw()" src="{{ imgUrl }}" /> </div> component.ts

draw(): void {
const quoteId=this.quoteId
const quoteService = this.quoteService
let painterro = Painterro({
backplateImgUrl: this.imgUrl,
defaultArrowLength: 5,
availableArrowLengths: [1,2,4,8,16,64],
saveHandler: function (image, done) {
quoteService.saveHandler(quoteId, image, done).pipe(
tap(res => {
if(res['status'] == 'saved'){
done(true); 
}
}),
).subscribe()
}
});
painterro.show()
}