I hope this message finds you well. I’m currently working on a project in Cocos Creator version 3.8.2 and I’m interested in implementing screenshot capture functionality using render texture. Despite my efforts to find relevant resources, I haven’t been able to locate a suitable guide or example for this version.
Could someone kindly point me in the right direction or share some insights on how to achieve this within the context of Cocos Creator 3.8.2? Any code snippets, tips, or documentation references would be greatly appreciated.
let imageU8Data = new Uint8Array(arrayBuffer);
//flip the picture
let picData = new Uint8Array(w * h * 4);
let rowBytes = w * 4;
for (let row = 0; row < h; row++) {
let srow = h - 1 - row;
let start = srow * w * 4;
let reStart = row * w * 4;
// save the piexls data
for (let i = 0; i < rowBytes; i++) {
picData[reStart + i] = imageU8Data[start + i];
}
}
jsb.saveImageData(picData, w, h, path);
Hey @Tom_k , just wanted to drop by and say a big thank you for your help with my question on the forum. Your response was incredibly helpful and I’m really grateful for your input