# ReImg

#### new Cesium.ReImg()
MapGIS/ReImg.js 7

用于保存图片

### Methods

#### static Cesium.ReImg.fromCanvas(canvasElement) → Object
MapGIS/ReImg.js 30

从 canvas 中获取图片信息

Name | Type | Description
--- | --- | ---
`canvasElement` | Object |

##### Returns:

返回对象组 {toBase64, toImg, toCanvas, toPng, toJpeg, downloadPng}

##### Example:

    // 获取 canvas 方法对象
    viewer.render();
    ReImg.fromCanvas(viewer.canvas);

    // 将画布保存为图片
    viewer.render();
    ReImg.fromCanvas(viewer.canvas).downloadPng(fileName);