We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add or paste an image?
The text was updated successfully, but these errors were encountered:
渲染单元格图片 我给你简单举个例子
fillImage(box: Box, cell: any, { fixWidth, fixHeight }: { fixWidth: number, fixHeight: number }, callback?: (width: number, height: number) => void) { const { x, y, width, height } = box; const dx = x + fixWidth; const dy = y + fixHeight; const { startRowIndex, startColIndex } = cell; const cellImage = this.imageCaches.get(`${startRowIndex}.${startColIndex}`); if (cellImage) { this.save() this.clearRect(x, y, width, height); this.context.drawImage(cellImage, Pixel.npx(x), Pixel.npx(y), Pixel.npx(width), Pixel.npx(height)); this.restore(); } else { const image = new Image(); image.src = 'https://theanam.github.io/react-awesome-lightbox/img/2.jpg' image.onload = () => { this.save() this.context.drawImage(image, Pixel.npx(dx), Pixel.npx(dy), Pixel.npx(image.width / 10), Pixel.npx(image.height / 10)); this.restore(); this.imageCaches.set(`${startRowIndex}.${startColIndex}`, image) callback?.(Pixel.npx(image.width / 12), Pixel.npx(image.height / 12)); } } }
Sorry, something went wrong.
Merge pull request #6 from lumeltech/dependabot/npm_and_yarn/loader-u…
ad74321
…tils-1.4.2
No branches or pull requests
How to add or paste an image?
The text was updated successfully, but these errors were encountered: