import { Base64Resource, DrawableResource, Group, Panel, jsx, Color, layoutConfig, Image, RemoteResource, MainBundleResource, Scroller, VLayout, Text, Gravity, createRef, loge, } from "doric"; import { colors, label } from "./utils"; import { img_base64 } from "./image_base64"; @Entry export class ResourceDemo extends Panel { build(root: Group): void { const iv = createRef(); async function click() { const imageInfo = await iv.current.getImageInfo(context); loge(imageInfo); const pixels = await iv.current.getImagePixels(context); loge(pixels.byteLength); const data = new Uint8Array(pixels); for (let i = 0; i < data.length - 4; i += 4) { data[i + 3] = 0xff / 3; } iv.current.imagePixels = { width: imageInfo.width, height: imageInfo.height, pixels: pixels, }; } Resource Demo {label("Button")} { await click(); }} /> ; } }