Skip to content

[minor] Copy and paste images through the system clipboard - #631

Merged
matt-edmondson merged 3 commits into
mainfrom
claude/project-thread-bnd8ln
Oct 12, 2026
Merged

matt-edmondson merged 3 commits into
mainfrom
claude/project-thread-bnd8ln

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: ImGuiApp's clipboard carried text only, so ImageGui kept its own per-platform image clipboard.

After: ImageClipboard.ForThisPlatform() gives any ImGuiApp application an IImageClipboard that reads and writes pictures on Windows, Linux (Wayland and X11) and macOS. TryReadPixels decodes what it reads with ImageDecoder, and TryWritePixels puts ImagePixels on the clipboard as a PNG and a bitmap.

How: the code moves from ImageGui's Clipboard/ folder nearly unchanged (Win32 through LibraryImport, wl-paste/wl-copy/xclip and osascript run from fixed system folders with a timeout). Only IImageClipboard, ClipboardImage and ImageClipboard are public. A small internal PngEncoder builds the PNG form for ClipboardImage.FromPixels. iOS gets the unsupported clipboard. ImageGui's clipboard tests move to tests/ImGui.App.Tests/Clipboard/, with new ones for the encoder and the pixel helpers; the ImGui.App test suite passes locally (584 passed, 2 skipped) and the solution builds in Release.

Closes #630.

🤖 Generated with Claude Code

https://claude.ai/code/session_016dGrC6C1oU6RQupTHitLVE


Generated by Claude Code

Moves ImageGui's image clipboard here: Win32, wl-clipboard/xclip and
osascript behind IImageClipboard, with ImageClipboard.ForThisPlatform,
TryReadPixels/TryWritePixels over ImageDecoder and a small PNG encoder.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dGrC6C1oU6RQupTHitLVE
@matt-edmondson matt-edmondson self-assigned this Oct 12, 2026
Comment thread ImGui.App/Clipboard/MacImageClipboard.cs Fixed
Comment thread ImGui.App/Clipboard/SystemClipboardProcesses.cs Fixed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dGrC6C1oU6RQupTHitLVE
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dGrC6C1oU6RQupTHitLVE
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add image clipboard support (copy and paste pictures) so ImageGui can drop its own

2 participants