0

この質問は少し長いので、明確にしようと思います。

On a website I co-develop, I created a drawing application that sends data about the lines drawn on the <canvas> element to the server to create an image and save it at multiple sizes, which works. There is the standard save which is saved to 320x212, with the smaller version at 240x176. However, some users on my site use a pretty antiquated device/browser for the application. It also has a smaller viewport, so the image is smaller, so server-side I'm currently multiplying the coordinates to compensate when saving the image to the standard size. But this has the side-effect of random unfilled parts of the image showing up, that were filled in on the canvas.

サンプル画像
(source: socialcu.be)

(小さいデバイスのビューポートのキャンバスでは、下部全体が緑色でしたが、座標を乗算して補正する方法により、拡大された画像に多くの塗りつぶされていない部分が表示されました)

私の最初の質問は、画像をベクター画像として作成し、(ベクターのままで) 拡大し、ラスター画像として保存すると、その問題が解決するのでしょうか?

次に (最初の答えが「はい」の場合)、PHP でこれを行う最善の方法は何でしょうか? Cairo については聞いたことがありますが、それに関する情報 (つまり、PHP パッケージのチュートリアル) はかなり不足しています。理想的には、Imagick でこれを行う方法、または Cairo の使用方法に関するチュートリアルはありますか?

4

1 に答える 1