Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad9586d

Browse files
Fix screenshot return in EJS_onSaveState (#1092)
* Fixed bug where a screenshot wasn't returned using EJS_onSaveState* Refactor takeScreenshot method to return a promise with screenshot data and format; update input element in HTML for better accessibility.
1 parentce7472d commitad9586d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎data/src/emulator.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7040,10 +7040,12 @@ class EmulatorJS {
70407040
}
70417041
}
70427042

7043-
asynctakeScreenshot(source,format,upscale){
7043+
takeScreenshot(source,format,upscale){
70447044
returnnewPromise((resolve)=>{
7045-
this.screenshot((blob,format)=>{
7046-
resolve({ blob, format});
7045+
this.screenshot(async(blob,returnFormat)=>{
7046+
constarrayBuffer=awaitblob.arrayBuffer();
7047+
constuint8=newUint8Array(arrayBuffer);
7048+
resolve({screenshot:uint8,format:returnFormat});
70477049
},source,format,upscale);
70487050
});
70497051
}

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <h1>EmulatorJS Demo</h1>
104104
<br>
105105
</div>
106106
<divid="box">
107-
<inputtype =fileid =input>
107+
<inputtype="file"id ="input"title="Upload"/>
108108
Drag ROM file or click here
109109
</div>
110110

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp