Repository navigation
[minor] Copy and paste images through the system clipboard - #631
Merged
Merged
Conversation
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
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
|
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 anIImageClipboardthat reads and writes pictures on Windows, Linux (Wayland and X11) and macOS.TryReadPixelsdecodes what it reads withImageDecoder, andTryWritePixelsputsImagePixelson the clipboard as a PNG and a bitmap.How: the code moves from ImageGui's
Clipboard/folder nearly unchanged (Win32 throughLibraryImport,wl-paste/wl-copy/xclipandosascriptrun from fixed system folders with a timeout). OnlyIImageClipboard,ClipboardImageandImageClipboardare public. A small internalPngEncoderbuilds the PNG form forClipboardImage.FromPixels. iOS gets the unsupported clipboard. ImageGui's clipboard tests move totests/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