zoom-image-data
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "zoom-image-data", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "zoom-image-data", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -102,3 +102,3 @@ # zoom-image-data | ||
### 5. 使用 | ||
以下为将一个原宽高为10*10的图像按宽高比为2绘制到指定宽高canvas元素 | ||
以下为将一个原宽高为64*64的图像按宽高比为2绘制到指定宽高canvas元素。[示例网站](https://fengqing1101.github.io/zoom-image-data/) | ||
##### html | ||
@@ -125,4 +125,4 @@ ```html | ||
const canvas = document.getElementById('canvas'); | ||
const inw = 10; | ||
const inh = 10; | ||
const inw = 64; | ||
const inh = 64; | ||
const inData = new ArrayBuffer(inw * inh * 4); | ||
@@ -143,5 +143,5 @@ const outw = document.body.clientWidth; | ||
cellRatio: 2, | ||
cellWH: 8, | ||
cellWH: 4, | ||
splitCell: true, | ||
splitCellSize: 8, | ||
splitCellSize: 10, | ||
}) | ||
@@ -167,3 +167,9 @@ | ||
function fillInData() { | ||
transferImageData.inData.fill(4291611705); | ||
const { inw, inh, inData } = transferImageData; | ||
for (let y = 0; y < inh; y++) { | ||
const s = 4291611705 - y * 512; | ||
for (let x = 0; x < inw; x++) { | ||
inData[y * inw + x] = s + x * 3; | ||
} | ||
} | ||
} | ||
@@ -170,0 +176,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218
17701
5