<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=Xamarin.Mac%2FNSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B</id>
	<title>Xamarin.Mac/NSViewの描画内容をファイルに保存する - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=Xamarin.Mac%2FNSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B"/>
	<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac/NSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B&amp;action=history"/>
	<updated>2026-06-05T18:26:44Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://monobook.org/w/index.php?title=Xamarin.Mac/NSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B&amp;diff=7426&amp;oldid=prev</id>
		<title>2015年8月20日 (木) 06:36に124.87.114.212による</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac/NSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B&amp;diff=7426&amp;oldid=prev"/>
		<updated>2015-08-20T06:36:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2015年8月20日 (木) 06:36時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;1行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==概要==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;絵心がなく[[Photoshop]]などのお絵描きソフトが使えないので、[[CoreGraphics]]を使い[[プログラム]]で描画し、その画像を[[ファイル]]に保存したい。簡易的なお絵描きソフト作れるかも。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==実装1==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==実装1==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;NSBitmapImageRepのコンストラクタの引数に画面の座標を指定すると、その範囲の[[スクリーンキャプチャ]]が取れる。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;NSBitmapImageRepのコンストラクタの引数に画面の座標を指定すると、その範囲の[[スクリーンキャプチャ]]が取れる。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;39行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;42行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{stub}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{stub}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[category:Xamarin.Mac]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>124.87.114.212</name></author>
	</entry>
	<entry>
		<id>https://monobook.org/w/index.php?title=Xamarin.Mac/NSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B&amp;diff=7425&amp;oldid=prev</id>
		<title>124.87.114.212: ページの作成:「==実装1== NSBitmapImageRepのコンストラクタの引数に画面の座標を指定すると、その範囲のスクリーンキャプチャが取れる。 &lt;sour...」</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac/NSView%E3%81%AE%E6%8F%8F%E7%94%BB%E5%86%85%E5%AE%B9%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B&amp;diff=7425&amp;oldid=prev"/>
		<updated>2015-08-20T06:32:58Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「==実装1== NSBitmapImageRepのコンストラクタの引数に画面の座標を指定すると、その範囲の&lt;a href=&quot;/w/index.php?title=%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%AD%E3%83%A3%E3%83%97%E3%83%81%E3%83%A3&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;「スクリーンキャプチャ」 (存在しないページ)&quot;&gt;スクリーンキャプチャ&lt;/a&gt;が取れる。 &amp;lt;sour...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==実装1==&lt;br /&gt;
NSBitmapImageRepのコンストラクタの引数に画面の座標を指定すると、その範囲の[[スクリーンキャプチャ]]が取れる。&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
    public class RadialLineView : NSView&lt;br /&gt;
    {&lt;br /&gt;
        //〜〜〜省略〜〜〜&lt;br /&gt;
 &lt;br /&gt;
        public override void DrawRect(CGRect dirtyRect)&lt;br /&gt;
        {&lt;br /&gt;
            base.DrawRect(dirtyRect);&lt;br /&gt;
&lt;br /&gt;
            var context = NSGraphicsContext.CurrentContext.GraphicsPort;&lt;br /&gt;
&lt;br /&gt;
            // 白色で塗りつぶす&lt;br /&gt;
            context.SetFillColor(1.0f, 1.0f, 1.0f, 1.0f);&lt;br /&gt;
            context.FillRect(dirtyRect);&lt;br /&gt;
&lt;br /&gt;
            // 黒色の丸を描く&lt;br /&gt;
            context.SetLineWidth(2.0f);&lt;br /&gt;
            context.SetStrokeColor(0.0f, 0.0f, 0.0f, 1.0f);&lt;br /&gt;
            context.StrokeEllipseInRect(dirtyRect);&lt;br /&gt;
&lt;br /&gt;
            // NSViewをロックしてビットマップを取得&lt;br /&gt;
            this.LockFocus();&lt;br /&gt;
            var rep = new NSBitmapImageRep(dirtyRect);&lt;br /&gt;
            this.UnlockFocus();&lt;br /&gt;
&lt;br /&gt;
            // TIFFファイルとして保存する&lt;br /&gt;
            rep.TiffRepresentation.Save(&amp;quot;/tmp/test.tiff&amp;quot;, true);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==関連項目==&lt;br /&gt;
*[[Xamarin.Mac/CoreGraphicsの基本的な使い方]]&lt;br /&gt;
&lt;br /&gt;
==参考文献==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>124.87.114.212</name></author>
	</entry>
</feed>