SancarSaran adlı üyeden alıntı
this dediği bu javascript kutuphanesinin instancesi...yani bu şey hede ise
sen o buttonun onclick eventine
hede.options.saveImg.apply(hede, [hede.getImage()]);
yazman lazım.
Teşekkürler hocam. Peki bu instance değerini nasıl bulabilirim. console.log(this) dediğim zaman şu şekilde bir sonuç alıyorum;
{$el: init(1), options: {…}, init: true, menus: {…}, previousMode: "text", …}
$canvas: init [canvas.wPaint-canvas, context: canvas.wPaint-canvas]
$canvasBg: init [canvas.wPaint-canvas-bg, context: canvas.wPaint-canvas-bg]
$canvasTemp: init [canvas.wPaint-canvas-temp, context: canvas.wPaint-canvas-temp]
$el: init [div#wPaint.wPaint-theme-classic.wPaint-theme-standard, context: div#wPaint.wPaint-theme-classic.wPaint-theme-standard]
$textCalc: init [div]
$textInput: init [textarea.wPaint-text-input]
canvas: canvas.wPaint-canvas
canvasBg: canvas.wPaint-canvas-bg
canvasTemp: canvas.wPaint-canvas-temp
ctx: CanvasRenderingContext2D {canvas: canvas.wPaint-canvas, globalAlpha: 1, globalCompositeOperation: "source-over", filter: "none", imageSmoothingEnabled: true, …}
ctxBg: CanvasRenderingContext2D {canvas: canvas.wPaint-canvas-bg, globalAlpha: 1, globalCompositeOperation: "source-over", filter: "none", imageSmoothingEnabled: true, …}
ctxBgResize: false
ctxResize: false
ctxTemp: CanvasRenderingContext2D {canvas: canvas.wPaint-canvas-temp, globalAlpha: 1, globalCompositeOperation: "source-over", filter: "none", imageSmoothingEnabled: true, …}
height: 500
init: true
menus: {primary: c, active: c, all: {…}}
options: {path: "/s/", theme: "standard classic", autoScaleImage: true, autoCenterImage: true, menuHandle: true, …}
previousMode: "text"
undoCurrent: 0
width: 650
__proto__: Object