0

I have code that allows me to obtain four coordinates:

initial_x initial_y final_x final_y

This coords form a rectangle which allows to crop the body of a website (all the area within the rectangle). My question is how can you save this cropped area as a file (export it to the machine likewise .jpeg for example) or just allocate memory from the browser to perform this task temporarily? This runs on javascript html and css

4

1 に答える 1

1

Javascript だけではこれを行うことはできません。座標データのパケット (javascript ツールを介して取得) とともに画像をサーバーにアップロードし、サーバー側でトリミングを行う必要があります (PHP のGDライブラリなどを介して)。トリミングされると、サーバーに保存され、その時点でクライアントにダウンロードできます。

これを行うためのツールはたくさんあります (おそらく、ゼロから自分で作成する必要はありません)。

http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11

于 2013-09-14T22:00:50.520 に答える