bright-gpu-74537
07/12/2022, 5:02 PMicy-zebra-52882
07/13/2022, 11:50 PMbright-gpu-74537
07/14/2022, 4:57 PMbright-gpu-74537
07/14/2022, 5:01 PMbest-agent-85158
07/14/2022, 7:42 PMbest-agent-85158
07/14/2022, 7:43 PMhaxe
var save = new haxe.ui.containers.dialogs.SaveFileDialog();
save.options = {
title: "Save Page Number" + (editor.pages.getChildIndex(this) + 1),
writeAsBinary: true
};
save.fileInfo = {
name: fileName,
isBinary: true,
bytes: switch type {
case PNG: bmp.encode(bmp.rect, new PNGEncoderOptions());
case JPG: bmp.encode(bmp.rect, new JPEGEncoderOptions());
default: throw new Exception("Unsupported file type");
}
};
save.show();
bright-gpu-74537
07/14/2022, 7:47 PMhaxe
if (fileInfo == null || (fileInfo.text == null && fileInfo.bytes == null)) {
throw "Nothing to write";
}
bright-gpu-74537
07/14/2022, 7:47 PMbest-agent-85158
07/14/2022, 7:55 PMbest-agent-85158
07/14/2022, 7:59 PMbest-agent-85158
07/14/2022, 8:00 PMBitmapData.encode()
doesnt like htmlbright-gpu-74537
07/14/2022, 8:00 PMtrace(bmp.encode(bmp.rect, new PNGEncoderOptions()) == null)
trace true or false?best-agent-85158
07/14/2022, 8:00 PMbest-agent-85158
07/14/2022, 8:00 PMbright-gpu-74537
07/14/2022, 8:00 PMbest-agent-85158
07/14/2022, 8:00 PMbest-agent-85158
07/14/2022, 8:01 PMbright-gpu-74537
07/14/2022, 8:01 PMbest-agent-85158
07/14/2022, 8:01 PMthis
bitmap, so it cant be null (its displayrd on the screen)best-agent-85158
07/14/2022, 8:02 PMbright-gpu-74537
07/14/2022, 8:03 PMbest-agent-85158
07/14/2022, 8:03 PMbest-agent-85158
07/14/2022, 8:03 PMbright-gpu-74537
07/14/2022, 8:04 PMbest-agent-85158
07/14/2022, 8:14 PMbest-agent-85158
07/14/2022, 8:15 PMhaxe
bmp.encode(bmp.rect, new PNGEncoderOptions(), byteArr);
this returns the correct value, even tho a byteArray is optional therebright-gpu-74537
07/14/2022, 8:19 PMbright-gpu-74537
07/14/2022, 8:20 PMbright-gpu-74537
07/14/2022, 8:22 PMbyteArray = null;
return null;
when none of the other branches matchbright-gpu-74537
07/14/2022, 8:22 PM