SWFファイル内の画像を表示/書き出しするGUIツール
修訂 | d63bff7e4019ce46d69f79353ff22e32372e3baa (tree) |
---|---|
時間 | 2016-09-30 20:50:13 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
画像をコピー出来るようにした
@@ -110,12 +110,12 @@ | ||
110 | 110 | <rect key="frame" x="216" y="0.0" width="404" height="500"/> |
111 | 111 | <autoresizingMask key="autoresizingMask"/> |
112 | 112 | <subviews> |
113 | - <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aA5-RV-VMg"> | |
113 | + <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="u2c-dB-mIy"> | |
114 | 114 | <rect key="frame" x="20" y="20" width="364" height="460"/> |
115 | 115 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
116 | - <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Umz-WW-g2L"/> | |
116 | + <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="wic-XG-vBm"/> | |
117 | 117 | <connections> |
118 | - <binding destination="UYM-GR-Pyx" name="value" keyPath="selection.image" id="oVK-ZM-QA8"/> | |
118 | + <binding destination="UYM-GR-Pyx" name="value" keyPath="selection.image" id="OXx-Tm-x6k"/> | |
119 | 119 | </connections> |
120 | 120 | </imageView> |
121 | 121 | </subviews> |
@@ -146,6 +146,13 @@ | ||
146 | 146 | </arrayController> |
147 | 147 | <menu id="lCG-dk-6rz"> |
148 | 148 | <items> |
149 | + <menuItem title="Copy" id="d9p-PZ-3gg"> | |
150 | + <modifierMask key="keyEquivalentModifierMask"/> | |
151 | + <connections> | |
152 | + <action selector="copy:" target="-2" id="ggr-15-tiC"/> | |
153 | + </connections> | |
154 | + </menuItem> | |
155 | + <menuItem isSeparatorItem="YES" id="fON-ES-Oye"/> | |
149 | 156 | <menuItem title="Export…" id="IWB-MT-07s"> |
150 | 157 | <modifierMask key="keyEquivalentModifierMask"/> |
151 | 158 | <connections> |
@@ -86,7 +86,7 @@ | ||
86 | 86 | return YES; |
87 | 87 | } |
88 | 88 | |
89 | -- (IBAction)exportSelection:(id)sender | |
89 | +- (HMSwfImage *)actionTarget | |
90 | 90 | { |
91 | 91 | HMSwfImage *swfImage = nil; |
92 | 92 |
@@ -98,10 +98,16 @@ | ||
98 | 98 | if(!swfImage) { |
99 | 99 | NSIndexSet *selectionIndexes = self.imagesController.selectionIndexes; |
100 | 100 | NSArray *selection = [self.swfImages objectsAtIndexes:selectionIndexes]; |
101 | - if(selection.count == 0) return; | |
101 | + if(selection.count == 0) return nil; | |
102 | 102 | swfImage = selection[0]; |
103 | 103 | } |
104 | 104 | |
105 | + return swfImage; | |
106 | +} | |
107 | + | |
108 | +- (IBAction)exportSelection:(id)sender | |
109 | +{ | |
110 | + HMSwfImage *swfImage = [self actionTarget]; | |
105 | 111 | if(!swfImage) return; |
106 | 112 | |
107 | 113 | NSSavePanel *panel = [NSSavePanel savePanel]; |
@@ -141,4 +147,12 @@ | ||
141 | 147 | }]; |
142 | 148 | } |
143 | 149 | |
150 | +- (IBAction)copy:(id)sender | |
151 | +{ | |
152 | + HMSwfImage *swfImage = [self actionTarget]; | |
153 | + NSPasteboard *pb = [NSPasteboard generalPasteboard]; | |
154 | + [pb clearContents]; | |
155 | + [pb writeObjects:@[swfImage.image]]; | |
156 | +} | |
157 | + | |
144 | 158 | @end |