Copy my own class (i.e., object) to clipboard?

5 ビュー (過去 30 日間)
Justin Solomon
Justin Solomon 2016 年 4 月 17 日
コメント済み: Justin Solomon 2016 年 4 月 29 日
I'm working on a image viewer/tool for 3D image stacks, imtool3D. Its built using MATLAB's object oriented programing features. I've written some ROI (region of interest) classes that are used to make measurements on the image. I'm trying to figure out a way to implement copy and paste for these ROI objects (i.e., if I have two imtool3D figures open, I want to copy an ROI from one and paste it to the other). Anyone ever done something like this? I'm not sure how I can send my object to the clipboard, or how I can access the clipboard to paste it. Any info would be much appreciated!
  4 件のコメント
per isakson
per isakson 2016 年 4 月 29 日
I thought "Which leads us to today’s chosen solution, where we use Matlab’s builtin functions getByteStreamFromArray and getArrayFromByteStream," might be a way to copy&paste an object.
Justin Solomon
Justin Solomon 2016 年 4 月 29 日
Ahh. I see where you're going with that. I think I can get that to work. Basically I'll convert my object to a byte stream, copy that to the clipboard. In the past method, save the clipboard to a str variable, convert it to an array, then change it back to an object. Thanks again!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by