0
我有一個問題。 我在畫布中創建了縮放圖像,但是我無法在raphaeljs中傳輸此圖像 如何縮放光標座標?放大image in raphaeljs
Raphaeljs: http://jsfiddle.net/qCzqF/2/
function zoomTo (x,y,z) {
c.translate(
originx,
originy
);
c.scale(z,z);
c.translate(
-(x/scale + originx - x/(scale * z)),
-(y/scale + originy - y/(scale * z))
);
originx = (x/scale + originx - x/(scale * z));
originy = (y/scale + originy - y/(scale * z));
scale *= z;
帆布: http://jsfiddle.net/JtctY/
function zoomTo (x,y,z) {
context.translate(
originx,
originy
);
context.scale(z,z);
context.translate(
-(x/scale + originx - x/(scale * z)),
-(y/scale + originy - y/(scale * z))
);
originx = (x/scale + originx - x/(scale * z));
originy = (y/scale + originy - y/(scale * z));
scale *= z;