From de61bd82025b7cbad753e4b9ea272705ed47cbf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Mar 2010 20:05:52 +0900 Subject: [PATCH] 12 --- dev3/Properties/AssemblyInfo.cs | 35 ++ dev3/PsychlopsSilverlight3.csproj | 78 ++++ dev3/WriteableBitmapEx/License.txt | 23 + dev3/WriteableBitmapEx/Readme.txt | 22 + dev3/WriteableBitmapEx/WriteableBitmapEx.XML | 600 +++++++++++++++++++++++++++ dev3/WriteableBitmapEx/WriteableBitmapEx.dll | Bin 0 -> 16384 bytes dev3/WriteableBitmapEx/WriteableBitmapEx.pdb | Bin 0 -> 42496 bytes dev3/psychlops/core/app/Class1.cs | 14 + dev3/psychlops/core/device/hid.cs | 88 ++++ dev3/psychlops/core/graphic/canvas.cs | 113 +++++ dev3/psychlops/core/graphic/module.cs | 184 ++++++++ dev3/psychlops/core/graphic/shape.cs | 198 +++++++++ dev3/psychlops/core/math/util.cs | 49 +++ dev3/psychlops/extention/standard/widget.cs | 17 + dev3/psychlops/psychlops.cs | 1 + test3/App.xaml | 8 + test3/App.xaml.cs | 66 +++ test3/MainPage.xaml | 9 + test3/MainPage.xaml.cs | 83 ++++ test3/Properties/AppManifest.xml | 7 + test3/Properties/AssemblyInfo.cs | 35 ++ test3/PsychlopsSilverlight3test.csproj | 102 +++++ 22 files changed, 1732 insertions(+) create mode 100644 dev3/Properties/AssemblyInfo.cs create mode 100644 dev3/PsychlopsSilverlight3.csproj create mode 100644 dev3/WriteableBitmapEx/License.txt create mode 100644 dev3/WriteableBitmapEx/Readme.txt create mode 100644 dev3/WriteableBitmapEx/WriteableBitmapEx.XML create mode 100644 dev3/WriteableBitmapEx/WriteableBitmapEx.dll create mode 100644 dev3/WriteableBitmapEx/WriteableBitmapEx.pdb create mode 100644 dev3/psychlops/core/app/Class1.cs create mode 100644 dev3/psychlops/core/device/hid.cs create mode 100644 dev3/psychlops/core/graphic/canvas.cs create mode 100644 dev3/psychlops/core/graphic/module.cs create mode 100644 dev3/psychlops/core/graphic/shape.cs create mode 100644 dev3/psychlops/core/math/util.cs create mode 100644 dev3/psychlops/extention/standard/widget.cs create mode 100644 dev3/psychlops/psychlops.cs create mode 100644 test3/App.xaml create mode 100644 test3/App.xaml.cs create mode 100644 test3/MainPage.xaml create mode 100644 test3/MainPage.xaml.cs create mode 100644 test3/Properties/AppManifest.xml create mode 100644 test3/Properties/AssemblyInfo.cs create mode 100644 test3/PsychlopsSilverlight3test.csproj diff --git a/dev3/Properties/AssemblyInfo.cs b/dev3/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..212e1f5 --- /dev/null +++ b/dev3/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("PsychlopsSilverlight3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PsychlopsSilverlight3")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 見えなくなります。このアセンブリ内で COM から型にアクセスする必要がある場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。 +[assembly: Guid("a37cfddf-f475-42fb-804c-66fa131de7fb")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています。 +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を +// 既定値にすることができます。 +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/dev3/PsychlopsSilverlight3.csproj b/dev3/PsychlopsSilverlight3.csproj new file mode 100644 index 0000000..7d45238 --- /dev/null +++ b/dev3/PsychlopsSilverlight3.csproj @@ -0,0 +1,78 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {58F3CEF1-8123-4105-9525-B7E2C7F188AC} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + PsychlopsSilverlight3 + PsychlopsSilverlight3 + v3.5 + false + true + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + False + WriteableBitmapEx\WriteableBitmapEx.dll + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev3/WriteableBitmapEx/License.txt b/dev3/WriteableBitmapEx/License.txt new file mode 100644 index 0000000..87bcae8 --- /dev/null +++ b/dev3/WriteableBitmapEx/License.txt @@ -0,0 +1,23 @@ +Microsoft Public License (Ms-PL) +[OSI Approved License] + +This license governs use of the accompanying software. If you use the software, you +accept this license. If you do not accept the license, do not use the software. + +1. Definitions +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the +same meaning here as under U.S. copyright law. +A "contribution" is the original software, or any additions or changes to the software. +A "contributor" is any person that distributes its contribution under this license. +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/dev3/WriteableBitmapEx/Readme.txt b/dev3/WriteableBitmapEx/Readme.txt new file mode 100644 index 0000000..d271870 --- /dev/null +++ b/dev3/WriteableBitmapEx/Readme.txt @@ -0,0 +1,22 @@ +Description +°°°°°°°°°°° + +The WriteableBitmapEx library is a collection of extension methods for Silverlight's WriteableBitmap. The WriteableBitmap class was added in Silverlight 3. It allows the direct manipulation of a bitmap and could be used to generate fast procedural images by drawing directly to a bitmap. The WriteableBitmap API is very minimalistic and there's only the raw Pixels array for such operations. The WriteableBitmapEx library tries to compensate that with extensions methods that are easy to use like built in methods. The library extends the WriteableBitmap class with elementary (2D drawing) functionality, supporting common shapes like point, line, ellipse, polyline, quad, rectangle, triangle, cubic Beziér and Cardinal spline. Conversion methods and functions to combine WriteableBitmaps (Blitting) are part of it too. +It is possible to use the built assembly that contains all extension methods or just specific methods by using the source CS files directly. The extension methods are grouped into multiple CS files. + +See http://writeablebitmapex.codeplex.com + + +Project structure +°°°°°°°°°°°°°°°°° + +It is possible to use the built assembly that contains all extension methods or just specific methods by using the CS files directly. The extension methods are grouped into multiple CS files. + +Solution: The Visual Studio solutions for the library itself and the samples. +Source: The Visual Studio projects for the samples and the library (WriteableBitmapEx) with the WriteableBitmap*Extensions.cs files. + + +License +°°°°°°° + +The library is released under the Microsoft Public License (Ms-PL). Please read the License.txt for details. \ No newline at end of file diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.XML b/dev3/WriteableBitmapEx/WriteableBitmapEx.XML new file mode 100644 index 0000000..5d8eaeb --- /dev/null +++ b/dev3/WriteableBitmapEx/WriteableBitmapEx.XML @@ -0,0 +1,600 @@ + + + + WriteableBitmapEx + + + + + Collection of blit (copy) extension methods for the Silverlight WriteableBitmap class. + + + Collection of interchange extension methods for the Silverlight WriteableBitmap class. + + + Collection of draw extension methods for the Silverlight WriteableBitmap class. + + + Collection of draw extension methods for the Silverlight WriteableBitmap class. + + + Collection of draw spline extension methods for the Silverlight WriteableBitmap class. + + + + + Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this). + + The destination WriteableBitmap. + The rectangle that defines the destination region. + The source WriteableBitmap. + The rectangle that will be copied from the source to the destination. + The blending mode . + + + + Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this). + + The destination WriteableBitmap. + The rectangle that defines the destination region. + The source WriteableBitmap. + The rectangle that will be copied from the source to the destination. + + + + Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this). + + The destination WriteableBitmap. + The destination position in the destination bitmap. + The source WriteableBitmap. + The rectangle that will be copied from the source to the destination. + If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent. + The blending mode . + + + + Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this). + + The destination WriteableBitmap. + The rectangle that defines the destination region. + The source WriteableBitmap. + The rectangle that will be copied from the source to the destination. + If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent. + The blending mode . + + + + Copies the Pixels from the WriteableBitmap into a ARGB byte array starting at a specific Pixels index. + + The WriteableBitmap. + The starting Pixels index. + The number of Pixels to copy. + The color buffer as byte ARGB values. + + + + Copies the Pixels from the WriteableBitmap into a ARGB byte array. + + The WriteableBitmap. + The number of pixels to copy. + The color buffer as byte ARGB values. + + + + Copies all the Pixels from the WriteableBitmap into a ARGB byte array. + + The WriteableBitmap. + The color buffer as byte ARGB values. + + + + Copies color information from an ARGB byte array into the WriteableBitmap starting at a specific buffer index. + + The WriteableBitmap. + The starting index in the buffer. + The number of bytes to copy from the buffer. + The color buffer as byte ARGB values. + + + + Copies color information from an ARGB byte array into the WriteableBitmap. + + The WriteableBitmap. + The number of bytes to copy from the buffer. + The color buffer as byte ARGB values. + + + + Copies all the color information from an ARGB byte array into the WriteableBitmap. + + The WriteableBitmap. + The color buffer as byte ARGB values. + + + + Writes the WriteableBitmap as a TGA image to a stream. + Used with permission from Nokola: http://nokola.com/blog/post/2010/01/21/Quick-and-Dirty-Output-of-WriteableBitmap-as-TGA-Image.aspx + + The WriteableBitmap. + The destination stream. + + + + Draws a colored line by connecting two points using the Bresenham algorithm. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using the Bresenham algorithm. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer). + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer). + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using an optimized DDA. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using an optimized DDA. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a colored line by connecting two points using an optimized DDA. + Uses the pixels array and the width directly for best performance. + + An array containing the pixels as int RGBA value. + The width of one scanline in the pixels array. + The height of the bitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color for the line. + + + + Draws a polyline. Add the first point also at the end of the array if the line should be closed. + + The WriteableBitmap. + The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn). + The color for the line. + + + + Draws a polyline. Add the first point also at the end of the array if the line should be closed. + + The WriteableBitmap. + The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn). + The color for the line. + + + + Draws a triangle. + + The WriteableBitmap. + The x-coordinate of the 1st point. + The y-coordinate of the 1st point. + The x-coordinate of the 2nd point. + The y-coordinate of the 2nd point. + The x-coordinate of the 3rd point. + The y-coordinate of the 3rd point. + The color. + + + + Draws a triangle. + + The WriteableBitmap. + The x-coordinate of the 1st point. + The y-coordinate of the 1st point. + The x-coordinate of the 2nd point. + The y-coordinate of the 2nd point. + The x-coordinate of the 3rd point. + The y-coordinate of the 3rd point. + The color. + + + + Draws a quad. + + The WriteableBitmap. + The x-coordinate of the 1st point. + The y-coordinate of the 1st point. + The x-coordinate of the 2nd point. + The y-coordinate of the 2nd point. + The x-coordinate of the 3rd point. + The y-coordinate of the 3rd point. + The x-coordinate of the 4th point. + The y-coordinate of the 4th point. + The color. + + + + Draws a quad. + + The WriteableBitmap. + The x-coordinate of the 1st point. + The y-coordinate of the 1st point. + The x-coordinate of the 2nd point. + The y-coordinate of the 2nd point. + The x-coordinate of the 3rd point. + The y-coordinate of the 3rd point. + The x-coordinate of the 4th point. + The y-coordinate of the 4th point. + The color. + + + + Draws a rectangle. + x2 has to be greater than x1 and y2 has to be greater than y1. + + The WriteableBitmap. + The x-coordinate of the bounding rectangle's left side. + The y-coordinate of the bounding rectangle's top side. + The x-coordinate of the bounding rectangle's right side. + The y-coordinate of the bounding rectangle's bottom side. + The color. + + + + Draws a rectangle. + x2 has to be greater than x1 and y2 has to be greater than y1. + + The WriteableBitmap. + The x-coordinate of the bounding rectangle's left side. + The y-coordinate of the bounding rectangle's top side. + The x-coordinate of the bounding rectangle's right side. + The y-coordinate of the bounding rectangle's bottom side. + The color. + + + + A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf + x2 has to be greater than x1 and y2 has to be greater than y1. + + The WriteableBitmap. + The x-coordinate of the bounding rectangle's left side. + The y-coordinate of the bounding rectangle's top side. + The x-coordinate of the bounding rectangle's right side. + The y-coordinate of the bounding rectangle's bottom side. + The color for the line. + + + + A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf + x2 has to be greater than x1 and y2 has to be greater than y1. + + The WriteableBitmap. + The x-coordinate of the bounding rectangle's left side. + The y-coordinate of the bounding rectangle's top side. + The x-coordinate of the bounding rectangle's right side. + The y-coordinate of the bounding rectangle's bottom side. + The color for the line. + + + + A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf + Uses a different parameter representation than DrawEllipse(). + + The WriteableBitmap. + The x-coordinate of the ellipses center. + The y-coordinate of the ellipses center. + The radius of the ellipse in x-direction. + The radius of the ellipse in y-direction. + The color for the line. + + + + A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf + Uses a different parameter representation than DrawEllipse(). + + The WriteableBitmap. + The x-coordinate of the ellipses center. + The y-coordinate of the ellipses center. + The radius of the ellipse in x-direction. + The radius of the ellipse in y-direction. + The color for the line. + + + + Fills the whole WriteableBitmap with a color. + + The WriteableBitmap. + The color used for filling. + + + + Fills the whole WriteableBitmap with an empty color (0). + + The WriteableBitmap. + + + + Clones the specified WriteableBitmap. + + The WriteableBitmap. + A copy of the WriteableBitmap. + + + + Applies the given function to all the pixels of the bitmap in + order to set their color. + + The WriteableBitmap. + The function to apply. With parameters x, y and a color as a result + + + + Applies the given function to all the pixels of the bitmap in + order to set their color. + + The WriteableBitmap. + The function to apply. With parameters x, y, source color and a color as a result + + + + Sets the color of the pixel using a precalculated index (faster). + + The WriteableBitmap. + The coordinate index. + The red value of the color. + The green value of the color. + The blue value of the color. + + + + Sets the color of the pixel. + + The WriteableBitmap. + The x coordinate (row). + The y coordinate (column). + The red value of the color. + The green value of the color. + The blue value of the color. + + + + Sets the color of the pixel including the alpha value and using a precalculated index (faster). + + The WriteableBitmap. + The coordinate index. + The alpha value of the color. + The red value of the color. + The green value of the color. + The blue value of the color. + + + + Sets the color of the pixel including the alpha value. + + The WriteableBitmap. + The x coordinate (row). + The y coordinate (column). + The alpha value of the color. + The red value of the color. + The green value of the color. + The blue value of the color. + + + + Sets the color of the pixel using a precalculated index (faster). + + The WriteableBitmap. + The coordinate index. + The color. + + + + Sets the color of the pixel. + + The WriteableBitmap. + The x coordinate (row). + The y coordinate (column). + The color. + + + + Sets the color of the pixel using an extra alpha value and a precalculated index (faster). + + The WriteableBitmap. + The coordinate index. + The alpha value of the color. + The color. + + + + Sets the color of the pixel using an extra alpha value. + + The WriteableBitmap. + The x coordinate (row). + The y coordinate (column). + The alpha value of the color. + The color. + + + + Sets the color of the pixel using a precalculated index (faster). + + The WriteableBitmap. + The coordinate index. + The color. + + + + Sets the color of the pixel. + + The WriteableBitmap. + The x coordinate (row). + The y coordinate (column). + The color. + + + + Draws a cubic Beziér spline defined by start, end and two control points. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the 1st control point. + The y-coordinate of the 1st control point. + The x-coordinate of the 2nd control point. + The y-coordinate of the 2nd control point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color. + + + + Draws a cubic Beziér spline defined by start, end and two control points. + + The WriteableBitmap. + The x-coordinate of the start point. + The y-coordinate of the start point. + The x-coordinate of the 1st control point. + The y-coordinate of the 1st control point. + The x-coordinate of the 2nd control point. + The y-coordinate of the 2nd control point. + The x-coordinate of the end point. + The y-coordinate of the end point. + The color. + + + + Draws a series of cubic Beziér splines each defined by start, end and two control points. + The ending point of the previous curve is used as starting point for the next. + Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point). + + The WriteableBitmap. + The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn). + The color for the spline. + + + + Draws a series of cubic Beziér splines each defined by start, end and two control points. + The ending point of the previous curve is used as starting point for the next. + Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point). + + The WriteableBitmap. + The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn). + The color for the spline. + + + + Draws a Cardinal spline (cubic) defined by four control points. + + The WriteableBitmap. + The x-coordinate of the 1st control point. + The y-coordinate of the 1st control point. + The x-coordinate of the 2nd control point. + The y-coordinate of the 2nd control point. + The x-coordinate of the 3rd control point. + The y-coordinate of the 3rd control point. + The x-coordinate of the 4th control point. + The y-coordinate of the 4th control point. + The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line. + The color. + + + + Draws a Cardinal spline (cubic) defined by a point collection. + The cardinal spline passes through each point in the collection. + + The WriteableBitmap. + The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn). + The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line. + The color for the spline. + + + + Draws a Cardinal spline (cubic) defined by a point collection. + The cardinal spline passes through each point in the collection. + + The WriteableBitmap. + The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn). + The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line. + The color for the spline. + + + + The blending mode. + + + + + Alpha blendiing uses the alpha channel to combine the source and destination. + + + + + Additive blending adds the colors of the source and the destination. + + + + + Subtractive blending subtracts the source color from the destination. + + + + + Uses the source color as a mask. + + + + + Multiplies the source color with the destination color. + + + + + No blending just copies the pixels from the source. + + + + diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.dll b/dev3/WriteableBitmapEx/W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s1jBy>nhfAL0yYc<2CQ-#!S24ak>}!qi&HGHlMr&DqM=o12 zgZZh$D)tG-F^~Pez&>6bJod&sFy+tkoA=W4!Gz4^apS||IKihd|UkEG30+7Wy=Hq8%+3k A0RR91 literal 0 HcmV?d00001 diff --git a/dev3/WriteableBitmapEx/WriteableBitmapEx.pdb b/dev3/WriteableBitmapEx/WriteableBitmapEx.pdb new file mode 100644 index 0000000000000000000000000000000000000000..8ab76d3658bb3653090bb68b6e5b701f7123b74c GIT binary patch literal 42496 zcmeI53!K$ewa5Pl@BkwygNT4UhBxvU7(gC^@){5n6a@urvKeL$%;+#P&I~db)gjTW zuCd_H=og!(&T=B`*F@b|C!MVp-(FN!{T@L z+H38-_TFnh{`6$LscnEpSU=QR1>|%Ffr;Zsa9}PrcHk|Lh%o_g`___~>-6tTeav^Q`0e zHfe#D=6@}Q;ry?-svF0*NfW%It8r-MMKiwJ@hAB=Es1tt`1y99eR%HqxBu?9KhD2t zhK-+i$Mu)xulh;;LnEW;P^SeCmHtc3%pX>KaN+$g%-*-L{tLIeEkktqH6QKs^t0dj z^Yh<-aK~?V?KnPNyhXg~X!ZZ*mo7Mb@^gvK@4xk>F3a{^`pR3R`tNu%k5>P8{N61E zd9UnycEn%qe0<=0AG`e>->`3y1~^*%Kk(e|J-K4TNjIJ|?Bx{$Qjf2Ai&Xy|Z|2eJ z|36;+<^Sq>|6>pCe1FxiQ>7PgeaAQKTdV<=o@Nd9_!cw&xVcBz0xBATXS`)K4$;X zG{4*yaO`TZq_V6omD~PD)BXl!f9$NEUDj|6jbBOb$IkX8b=6fh$I$u)lYg%L`7Mn8 z_rN=cx3^oMG(-GX(7(YO0BXdSLJEH&{W5n9e4=F?|NkA+0;fMUE-?;w7NrY zUP7Mnw}cZA&V!`)ZRbVuv=PLW_Z7F4cU#V9d7wN}X(`Z$Qa*Uud-p8;U&$&j$(BN) ztUTAtjz64eCs}#4WR(`m%Im%CPflA@Az6(E$to?BmG^tu)VDTXELn{T$to?Bh4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ez;(v!FT9Y^WHT g3(bShh2}&5NTH=Y-#?Ol$89;@0>@k6*tNj_1L)b`pa1{> literal 0 HcmV?d00001 diff --git a/dev3/psychlops/core/app/Class1.cs b/dev3/psychlops/core/app/Class1.cs new file mode 100644 index 0000000..d0069f7 --- /dev/null +++ b/dev3/psychlops/core/app/Class1.cs @@ -0,0 +1,14 @@ + + +namespace Psychlops +{ + + + public static class Main + { + public delegate void func(); + public static Drawable drawable; + } + + +} diff --git a/dev3/psychlops/core/device/hid.cs b/dev3/psychlops/core/device/hid.cs new file mode 100644 index 0000000..ff671b5 --- /dev/null +++ b/dev3/psychlops/core/device/hid.cs @@ -0,0 +1,88 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; + + +namespace Psychlops +{ + public class HID + { + public struct Button + { + private bool pushed_, released_, pressed_; + public void down() + { + pushed_ = true; + pressed_ = true; + } + public void up() + { + released_ = true; + pressed_ = false; + } + public bool pushed() { bool tmp = pushed_; pushed_ = false; return tmp; } + public bool released() { bool tmp = released_; released_ = false; return tmp; } + public bool pressed() { return pressed_; } + } + } + + public class Keyboard + { + static public HID.Button + esc, spc, rtn, + left, right, up, down, + comma, period, + q,w,e,r,t,y,u,i,o,p, + a,s,d,f,g,h,j,k,l, + z,x,c,v,b,n,m, + one, two, three, four, five, six, seven, eight, nine, zero, + pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7, pad8, pad9; + static private System.Collections.Generic.Dictionary map; + static public void Canvas_KeyUp(object sender, KeyEventArgs e) + { + } + static public void Canvas_KeyDown(object sender, KeyEventArgs e) + { + } + } + + public class Mouse + { + static protected Point position_; + static internal System.Windows.UIElement _prime; + static public HID.Button left, right, middle; + static protected Point wheelDelta_; + + static public Point position { get { return position_; } } + static public int x { get { return (int)position_.x; } } + static public int y { get { return (int)position_.y; } } + static public Point wheelDelta { get { return wheelDelta_; } } + + static public void Canvas_MousePos(object sender, MouseEventArgs e) + { + System.Windows.Point p = e.GetPosition(_prime); + position_.set(p.X, p.Y); + } + static public void Canvas_LDown(object sender, MouseEventArgs e) + { + left.down(); + System.Windows.Point p = e.GetPosition(_prime); + position_.set(p.X, p.Y); + } + static public void Canvas_LUp(object sender, MouseEventArgs e) + { + left.up(); + System.Windows.Point p = e.GetPosition(_prime); + position_.set(p.X, p.Y); + } + static public void Canvas_MouseWheel(object sender, MouseWheelEventArgs e) + { + wheelDelta_.y += e.Delta; + System.Windows.Point p = e.GetPosition(_prime); + position_.set(p.X, p.Y); + } + } + +} \ No newline at end of file diff --git a/dev3/psychlops/core/graphic/canvas.cs b/dev3/psychlops/core/graphic/canvas.cs new file mode 100644 index 0000000..8dd4753 --- /dev/null +++ b/dev3/psychlops/core/graphic/canvas.cs @@ -0,0 +1,113 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + + + +namespace Psychlops +{ + + public class Canvas : Drawable + { + public static System.Windows.Controls.Image default_instance; + public static System.Windows.Controls.UserControl default_panel; + public static WriteableBitmap default_buffer; + System.Windows.Controls.Image instance; + System.Windows.Controls.UserControl panel; + WriteableBitmap buffer; + + public Canvas(int wid, int hei) + { + panel = default_panel; + instance = default_instance; + instance.Width = wid; + instance.Height = hei; + buffer = new WriteableBitmap((int)instance.Width, (int)instance.Height); + instance.Source = buffer; + instance.MouseMove += Mouse.Canvas_MousePos; + instance.MouseLeftButtonDown += Mouse.Canvas_LDown; + instance.MouseLeftButtonUp += Mouse.Canvas_LUp; + instance.MouseWheel += Mouse.Canvas_MouseWheel; + Mouse._prime = instance; + Main.drawable = this; + default_buffer = buffer; + } + public Canvas(int wid, int hei, System.Windows.Controls.Image target, System.Windows.Controls.UserControl system) + { + panel = system; + instance = target; + instance.Width = wid; + instance.Height = hei; + buffer = new WriteableBitmap((int)instance.Width, (int)instance.Height); + instance = target; + instance.Source = buffer; + instance.MouseMove += Mouse.Canvas_MousePos; + instance.MouseLeftButtonDown += Mouse.Canvas_LDown; + instance.MouseLeftButtonUp += Mouse.Canvas_LUp; + instance.MouseWheel += Mouse.Canvas_MouseWheel; + Mouse._prime = instance; + Main.drawable = this; + } + public Point getCenter() + { + return new Point(instance.Width/2.0, instance.Height/2.0, 0); + } + + public void clear() + { + buffer.Clear(Color.black); + } + public void clear(Color col) + { + buffer.Clear(col); + } + + public void pix(int x, int y, Color col) + { + buffer.SetPixel(x, y, col); + } + + + public void line(Line drawee, Color col) + { + buffer.DrawLine((int)drawee.begin.x, (int)drawee.begin.y, (int)drawee.end.x, (int)drawee.end.y, col); + } + public void rect(Rectangle drawee, Color col) + { + buffer.DrawRectangle((int)drawee.v1.x, (int)drawee.v1.y, (int)drawee.v2.x, (int)drawee.v2.y, col); + } + public void ellipse(Ellipse drawee, Color col) + { + buffer.DrawEllipse((int)(drawee.datum.x - drawee.xdiameter / 2), (int)(drawee.datum.y - drawee.ydiameter / 2), (int)(drawee.datum.x + drawee.xdiameter / 2), (int)(drawee.datum.y + drawee.ydiameter / 2), col); + } + public void polygon(Polygon drawee, Color col) + { + int[] ps = new int[drawee.vertices.Count]; + int i=0; + foreach (Point p in drawee.vertices) + { + ps[i] = (int)p.x; i++; + ps[i] = (int)p.y; i++; + } + buffer.DrawPolyline(ps, col); + } + public void image(Image drawee) + { + buffer.Blit(drawee.datum, drawee.buffer, drawee.self_rect, Colors.White, WriteableBitmapExtensions.BlendMode.None); + } + + + public void flip() + { + buffer.Invalidate(); + } + } + + +} \ No newline at end of file diff --git a/dev3/psychlops/core/graphic/module.cs b/dev3/psychlops/core/graphic/module.cs new file mode 100644 index 0000000..b21784c --- /dev/null +++ b/dev3/psychlops/core/graphic/module.cs @@ -0,0 +1,184 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + + + +namespace Psychlops +{ + + public struct Point + { + public double x, y, z; + public Point(double dx, double dy, double dz) + { + x = dx; + y = dy; + z = dz; + } + public Point(double dx, double dy) + { + x = dx; + y = dy; + z = 0.0; + } + public Point set(double dx, double dy, double dz) + { + x = dx; + y = dy; + z = dz; + return this; + } + public Point set(double dx, double dy) + { + x = dx; + y = dy; + z = 0.0; + return this; + } + + public static Point operator +(Point lhs, Point rhs) + { + return new Point(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); + } + public static Point operator -(Point lhs, Point rhs) + { + return new Point(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); + } + public static implicit operator System.Windows.Point(Point d) + { + return new System.Windows.Point(d.x, d.y); + } + } + + + public struct Color + { + public double r, g, b, a; + public Color(double lum) + { + r = g = b = lum; + a = 1.0; + } + public Color(double red, double green, double blue, double alpha) + { + r = red; + g = green; + b = blue; + a = alpha; + } + public static implicit operator System.Windows.Media.Color(Color d) + { + return System.Windows.Media.Color.FromArgb((byte)(d.a * 255), (byte)(d.r * 255), (byte)(d.g * 255), (byte)(d.b * 255)); + } + + public static readonly Color + black = new Color(0, 0, 0, 1), + red = new Color(1, 0, 0, 1), + green = new Color(0, 1, 0, 1), + blue = new Color(0, 0, 1, 1), + yellow = new Color(1, 1, 0, 1), + magenta = new Color(1, 0, 1, 1), + cyan = new Color(0, 1, 1, 1), + white = new Color(1, 1, 1, 1), + gray = new Color(.5, .5, .5, 1); + + } + + + public interface Drawable + { + Point getCenter(); + void clear(Color col); + void pix(int x, int y, Color col); + void line(Line drawee, Color col); + void rect(Rectangle drawee, Color col); + void ellipse(Ellipse drawee, Color col); + void image(Image drawee); + void polygon(Polygon drawee, Color col); + } + + + + public interface Figure + { + Figure shift(Point p); + Figure centering(Point p); + void draw(); + } + public static class FigureExtention + { + public static Figure shift(this Figure target, double x, double y) + { + return target.shift(new Point(x, y)); + } + public static Figure centering(this Figure target) + { + return target.centering(Main.drawable.getCenter()); + } + } + + + + public class Image : Figure + { + public WriteableBitmap buffer; + public Point datum; + public Rectangle self_rect; + + public Image(int wid, int hei) + { + buffer = new WriteableBitmap(wid, hei); + self_rect = new Rectangle(wid, hei); + } + + /*public Image shift(double x, double y) + { + datum.x += x; + datum.y += y; + return this; + }*/ + public Figure shift(Point p) + { + datum += p; + return this; + } + public Figure centering(Point p) + { + datum.x = p.x - width / 2.0; + datum.y = p.y - height / 2.0; + return this; + } + + public void pix(int x, int y, Color col) + { + buffer.SetPixel(x, y, col); + } + + + public void field(System.Func func) + { + buffer.ForEach(func); + } + public void field(System.Func func) + { + buffer.ForEach(func); + } + + public void draw() + { + Main.drawable.image(this); + } + + public double width { get { return self_rect.width; } } + public double height { get { return self_rect.height; } } + + } + +} \ No newline at end of file diff --git a/dev3/psychlops/core/graphic/shape.cs b/dev3/psychlops/core/graphic/shape.cs new file mode 100644 index 0000000..71f33cb --- /dev/null +++ b/dev3/psychlops/core/graphic/shape.cs @@ -0,0 +1,198 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + + + +namespace Psychlops{ + + public interface Shape : Figure + { + } + public static class ShapeExtention + { + /* + public static void draw(this Shape drawee) + { + drawee.draw(Color.white); + } + */ + } + + + public class Line : Shape + { + public Point begin, end; + + public Line(Point v1, Point v2) + { + begin = v1; + end = v2; + } + + public Figure shift(Point p) + { + begin += p; + end += p; + return this; + } + public Figure centering(Point p) + { + double h = width, v = height; + begin.x = p.x - h / 2.0; + begin.y = p.y - v / 2.0; + end.x = begin.x + h; + end.y = begin.y + v; + return this; + } + + public void draw(Color c) + { + Main.drawable.line(this, c); + } + public void draw() + { + Main.drawable.line(this, Color.white); + } + + public double width { get { return Math.abs(begin.x - end.x); } } + public double height { get { return Math.abs(begin.y - end.y); } } + + public static implicit operator System.Windows.Shapes.Line(Line d) + { + var tmp = new System.Windows.Shapes.Line(); + tmp.X1 = d.begin.x; + tmp.Y1 = d.begin.y; + tmp.X2 = d.end.x; + tmp.Y2 = d.end.y; + return tmp; + } + } + + + public class Rectangle : Shape + { + public Point v1, v2; + + public Rectangle() + { + set(0,0); + } + public Rectangle(double wid, double hei) + { + set(wid, hei); + } + + public Rectangle set(double wid, double hei) + { + v1.set(0, 0, 0); + v2.set(wid, hei, 0); + return this; + } + + public Figure shift(Point p) + { + v1 += p; + v2 += p; + return this; + } + public Figure centering(Point p) + { + double h = width, v = height; + v1.x = p.x - h / 2.0; + v1.y = p.y - v / 2.0; + v2.x = v1.x + h; + v2.y = v1.y + v; + return this; + } + + public void draw(Color c) + { + Main.drawable.rect(this, c); + } + public void draw() + { + Main.drawable.rect(this, Color.white); + } + + public double width { get { return Math.abs(v1.x - v2.x); } } + public double height { get { return Math.abs(v1.y - v2.y); } } + + + public static implicit operator System.Windows.Rect(Rectangle d) + { + return new System.Windows.Rect(d.v1.x, d.v1.y, d.v2.x, d.v2.y); + } + + } + + + public class Ellipse : Shape + { + public Point datum; + public double xdiameter, ydiameter; + + public Figure shift(Point p) + { + datum += p; + return this; + } + public Figure centering(Point p) + { + datum = p; + return this; + } + + public void draw(Color c) + { + Main.drawable.ellipse(this, c); + } + public void draw() + { + Main.drawable.ellipse(this, Color.white); + } + } + + + public class Polygon : Shape + { + public Point datum; + public System.Collections.Generic.List vertices; + + public Polygon() + { + vertices = new System.Collections.Generic.List(); + } + public Polygon append(Point p) { vertices.Add(p); return this; } + public Polygon append(double x, double y) { return append(new Point(x, y, 0.0)); } + public Polygon append(double x, double y, double z) { return append(new Point(x, y, z)); } + + + public Figure shift(Point p) + { + datum += p; + return this; + } + public Figure centering(Point p) + { + datum = p; + return this; + } + + public void draw(Color c) + { + Main.drawable.polygon(this, c); + } + public void draw() + { + Main.drawable.polygon(this, Color.white); + } + } + +} \ No newline at end of file diff --git a/dev3/psychlops/core/math/util.cs b/dev3/psychlops/core/math/util.cs new file mode 100644 index 0000000..3d451a8 --- /dev/null +++ b/dev3/psychlops/core/math/util.cs @@ -0,0 +1,49 @@ +using System; + +namespace Psychlops +{ + + public static class Math + { + public static readonly double PI = 3.14159265, E = 2.718281828459045; + public static double abs(double x) + { + return System.Math.Abs(x); + } + public static double sin(double x) + { + return System.Math.Sin(x); + } + public static double cos(double x) + { + return System.Math.Cos(x); + } + public static double tan(double x) + { + return System.Math.Tan(x); + } + public static double sqrt(double x) + { + return System.Math.Sqrt(x); + } + public static double exp(double x) + { + return System.Math.Exp(x); + } + public static double log(double x) + { + return System.Math.Log(x); + } + public static double radius(double x, double y) + { + return System.Math.Sqrt(x * x + y * y); + } + + + public static double gaussian(double x, double sigma) + { + return exp(- (x*x) / (2*sigma*sigma)); + } + } + +} \ No newline at end of file diff --git a/dev3/psychlops/extention/standard/widget.cs b/dev3/psychlops/extention/standard/widget.cs new file mode 100644 index 0000000..21229f4 --- /dev/null +++ b/dev3/psychlops/extention/standard/widget.cs @@ -0,0 +1,17 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + + + +namespace Psychlops +{ + + +} \ No newline at end of file diff --git a/dev3/psychlops/psychlops.cs b/dev3/psychlops/psychlops.cs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/dev3/psychlops/psychlops.cs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test3/App.xaml b/test3/App.xaml new file mode 100644 index 0000000..203356e --- /dev/null +++ b/test3/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/test3/App.xaml.cs b/test3/App.xaml.cs new file mode 100644 index 0000000..51613a1 --- /dev/null +++ b/test3/App.xaml.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PsychlopsSilverlight3test +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // アプリケーションがデバッガーの外側で実行されている場合、ブラウザーの + // 例外メカニズムによって例外が報告されます。これにより、IE ではステータス バーに + // 黄色の通知アイコンが表示され、Firefox にはスクリプト エラーが表示されます。 + if (!System.Diagnostics.Debugger.IsAttached) + { + + // メモ : これにより、アプリケーションは例外がスローされた後も実行され続け、例外は + // ハンドルされません。 + // 実稼動アプリケーションでは、このエラー処理は、Web サイトにエラーを報告し、 + // アプリケーションを停止させるものに置換される必要があります。 + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/test3/MainPage.xaml b/test3/MainPage.xaml new file mode 100644 index 0000000..1f1bbde --- /dev/null +++ b/test3/MainPage.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/test3/MainPage.xaml.cs b/test3/MainPage.xaml.cs new file mode 100644 index 0000000..d06eb7a --- /dev/null +++ b/test3/MainPage.xaml.cs @@ -0,0 +1,83 @@ +using Psychlops; + +namespace PsychlopsSilverlight3test +{ + public partial class MainPage : System.Windows.Controls.UserControl + { + public System.ComponentModel.BackgroundWorker main_routine; + public System.Windows.Controls.Image master; + public MainPage() + { + InitializeComponent(); + initialize(); + // Show fps counter + Canvas.default_instance = image; + System.Windows.Application.Current.Host.Settings.MaxFrameRate = 60; + System.Windows.Application.Current.Host.Settings.EnableFrameRateCounter = true; + System.Windows.Application.Current.Host.Settings.EnableCacheVisualization = true; + System.Windows.Media.CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering); + //main_routine = new System.ComponentModel.BackgroundWorker(); + //main_routine.DoWork += new System.ComponentModel.DoWorkEventHandler(psychlops_main); + //main_routine.RunWorkerAsync(); + } + int background; + private void backgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs args) + { + while (true) + { + System.Threading.Thread.Sleep(10); + background++; + } + } + + int frame; + private void CompositionTarget_Rendering(object sender, System.EventArgs e) + { + frame++; + //Canvas.default_buffer.Invalidate(); + trial(); + } + + Canvas cnvs; + Image img; + int isize = 100; + double tfreq = 1; + public void initialize() + { + cnvs = new Canvas(500, 500, image, this); + img = new Image(isize*2, isize*2); + cnvs.clear(Color.gray); + } + public void trial() + { + cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5)); + img.field( + (x, y) => new Color(.5 + Math.gaussian(Math.radius(x - isize, y - isize), isize / 8.0) * .5 * Math.sin(frame*2*Math.PI/tfreq/60 + x / 3.0)) + ); + img.centering(Mouse.position); + //img.shift(1,0); + img.draw(); + cnvs.flip(); + } + /* + Canvas cnvs; + Rectangle[] rects; + double tfreq = 1; + + public void initialize() + { + cnvs = new Canvas(500, 500, image, this); + rects = new Rectangle[100]; + for (int i = 0; i < rects.Length; i++) { rects[i] = new Rectangle(10,10); } + cnvs.clear(Color.gray); + } + public void trial() + { + cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5)); + foreach (Rectangle rect in rects) { rect.centering().shift(background,0).draw(); } + cnvs.flip(); + } + */ + } +} + diff --git a/test3/Properties/AppManifest.xml b/test3/Properties/AppManifest.xml new file mode 100644 index 0000000..151cfa5 --- /dev/null +++ b/test3/Properties/AppManifest.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/test3/Properties/AssemblyInfo.cs b/test3/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..074953b --- /dev/null +++ b/test3/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("PsychlopsSilverlight3test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PsychlopsSilverlight3test")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 見えなくなります。このアセンブリ内で COM から型にアクセスする必要がある場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。 +[assembly: Guid("631fa262-58de-42ab-ba9d-79cb7cf7e289")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています。 +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を +// 既定値にすることができます。 +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/test3/PsychlopsSilverlight3test.csproj b/test3/PsychlopsSilverlight3test.csproj new file mode 100644 index 0000000..d56b2aa --- /dev/null +++ b/test3/PsychlopsSilverlight3test.csproj @@ -0,0 +1,102 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {23080448-E8EF-4766-9ACE-4448C61931DB} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + PsychlopsSilverlight3test + PsychlopsSilverlight3test + v3.5 + true + ja + true + true + PsychlopsSilverlight3test.xap + Properties\AppManifest.xml + PsychlopsSilverlight3test.App + TestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + False + ..\dev3\PsychlopsSilverlight3\Bin\Debug\PsychlopsSilverlight3.dll + + + + + + + + + + + + App.xaml + + + MainPage.xaml + + + + + + Designer + MSBuild:MarkupCompilePass1 + + + Designer + MSBuild:MarkupCompilePass1 + + + + + + + + + + + + + + + \ No newline at end of file -- 2.11.0