Compare commits

..

No commits in common. "1.0.2" and "master" have entirely different histories.

6 changed files with 7 additions and 21 deletions

View File

@ -2,8 +2,6 @@
VSCodeで画像に赤丸マークや注釈を直感的に描き込める拡張機能です。 VSCodeで画像に赤丸マークや注釈を直感的に描き込める拡張機能です。
![logo](readme/images/logo.png)
--- ---
## 主な特徴 ## 主な特徴

View File

@ -2,8 +2,6 @@
# ImageMarkPengent # ImageMarkPengent
![logo](readme/images/logo.png)
A VSCode extension for intuitively drawing red circle marks and annotations directly on images. A VSCode extension for intuitively drawing red circle marks and annotations directly on images.
--- ---

View File

@ -3,9 +3,7 @@
"displayName": "ImageMarkPengent", "displayName": "ImageMarkPengent",
"description": "", "description": "",
"license": "MIT", "license": "MIT",
"version": "1.0.2", "version": "1.0.0-alpha",
"publisher": "PengentAIRyohYA",
"icon": "readme/images/logo.png",
"engines": { "engines": {
"vscode": "^1.99.0" "vscode": "^1.99.0"
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

View File

@ -89,9 +89,6 @@ export function getWebviewContent(imageSrc: string): string {
let markColor = colorPicker.value; let markColor = colorPicker.value;
let markLineWidth = parseInt(lineWidthSelect.value, 10); let markLineWidth = parseInt(lineWidthSelect.value, 10);
// VS Code API を一度だけ取得
const vscode = window.acquireVsCodeApi ? window.acquireVsCodeApi() : null;
// UIイベント // UIイベント
moveBtn.onclick = () => setMode('move'); moveBtn.onclick = () => setMode('move');
selectBtn.onclick = () => setMode('select'); selectBtn.onclick = () => setMode('select');
@ -121,7 +118,6 @@ export function getWebviewContent(imageSrc: string): string {
draw(); draw();
}; };
saveBtn.onclick = () => { saveBtn.onclick = () => {
console.log('Save button onclick fired!');
// 元画像サイズのオフスクリーンcanvasで保存 // 元画像サイズのオフスクリーンcanvasで保存
const offCanvas = document.createElement('canvas'); const offCanvas = document.createElement('canvas');
offCanvas.width = img.width; offCanvas.width = img.width;
@ -134,13 +130,9 @@ export function getWebviewContent(imageSrc: string): string {
drawEllipseRaw(offCtx, mark.x1, mark.y1, mark.x2, mark.y2, mark.color, mark.lineWidth); drawEllipseRaw(offCtx, mark.x1, mark.y1, mark.x2, mark.y2, mark.color, mark.lineWidth);
} }
const dataUrl = offCanvas.toDataURL('image/png'); const dataUrl = offCanvas.toDataURL('image/png');
console.log('Data URL created, checking VSCode API...'); if (window.acquireVsCodeApi) {
if (vscode) { const vscode = window.acquireVsCodeApi();
console.log('VSCode API available, sending message...');
vscode.postMessage({ type: 'save-image', dataUrl }); vscode.postMessage({ type: 'save-image', dataUrl });
console.log('Message sent to extension');
} else {
console.log('VSCode API not available!');
} }
}; };