2011年6月30日 星期四

Microsoft azure - Google Map API, Skydrive pptx

1. Microsoft 還蠻夠意思,帳號到期還可以用一下。
2. 測試原有專案(queuecode)。
3. GuestBook_WebRole加入Webform2.aspx(Google Map API)

4. 再加入WebForm3.aspx 用iframe內置Skydrive公用屬性的pptx

2011年6月29日 星期三

Microsoft skydrive testing

突然間Office 365新聞很多,趕快來試試看Web Office
1. 登入windows Live
2. ppt 測試


3. Excel 測試


4. 網路硬碟測試(下載OK, 上傳有些問題?)
用 SkydriveSimpleViewer找出網路硬碟設定, e.g.
\\lkdpxx.docs.live.net\3bd9ec3d389212xx\
不同的id: lkdpxx 似乎都指向根目錄。


今天圖片上傳有問題,改天再傳圖。

2011年6月19日 星期日

Microsoft Kinect(第三課 SkeletonFrame)

Ref : SketetalViewer_Walkthrough.docx
PART 3—C# SkeletalViewer Sample
1. Open WPF Application
2. Add ref Microsoft.Research.Kinect
3. Add using Microsoft.Research.Kinect.Nui;
4. Copy parts of sample code as follows to test videostream function
4-1 Global variables
Runtime nui;
int totalFrames = 0;
int lastFrames = 0;
DateTime lastTime = DateTime.MaxValue;
const int RED_IDX = 2;
const int GREEN_IDX = 1;
const int BLUE_IDX = 0;
Dictionary<JointID, Brush> jointColors = new Dictionary<JointID, Brush>() { ...

4-2 Window_Loaded event method (Parts of them from example)
Key steps:
4-2-1 Create Runtime object
nui = new Runtime();
4-2-2 Initialize Runtime object
nui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);
4-2-3 Open VideoStream
nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);
4-2-4 Set SkeletonFrameReady event
nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

4-3 Copy methods from example
4-3-1 getDisplayPosition
4-3-2 getBodySegment
4-3-3 nui_SkeletonFrameReady

4-4 Notes: Don't miss Width and Height settings in canvas.
<Canvas Name="skeleton" Width="300" Height="400" Margin="278,20,20,20" Background="Black" ClipToBounds="True" />

5 Download https://sites.google.com/site/csjoublogfiles/home/files/SDKSkeleton.zip

Microsoft Kinect(第二課 VideoStream)

Ref : SketetalViewer_Walkthrough.docx
PART 3—C# SkeletalViewer Sample
The C# SkeletalViewer application is installed in the following folder:
Users\Public\Documents\Microsoft Research KinectSDK Samples\NUI\SkeletalViewer\CS
The sample is implemented in the following files:
• App.xaml declares application-level resources.
• App.xaml.cs contains the code behind app.xaml.
• MainWindow.xaml declares the layout of the main application window.
• MainWindow.xaml.cs contains the code behind the main window, which implements NUI API initialization, processing and display.
• SkeletalViewer.ico defines the application icon that is used in title bar and task bar.
1. Open WPF Application
2. Add ref Microsoft.Research.Kinect
3. Add using Microsoft.Research.Kinect.Nui;
4. Copy parts of sample code as follows to test videostream function
4-1  Global variables
        Runtime nui;
        int totalFrames = 0;
        int lastFrames = 0;
        DateTime lastTime = DateTime.MaxValue;
        const int RED_IDX = 2;
        const int GREEN_IDX = 1;
        const int BLUE_IDX = 0;

4-2 Window_Loaded event method (Parts of them from example)
Key steps:
4-2-1 Create Runtime object
  nui = new Runtime();
4-2-2 Initialize Runtime object
  nui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);
4-2-3 Open VideoStream
 nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);
4-2-4 Set VideoFrameReady event
 nui.VideoFrameReady += new EventHandler<ImageFrameReadyEventArgs>(nui_VideoFrameReady); 

       
4-3 VideoFrameReady event method (Copy from sample)
  // 32-bit per pixel, RGBA image
            PlanarImage Image = e.ImageFrame.Image;
            im1.Source = BitmapSource.Create(
                Image.Width, Image.Height, 96, 96, PixelFormats.Bgr32, null, Image.Bits, Image.Width * Image.BytesPerPixel);
            ++totalFrames;
            DateTime cur = DateTime.Now;
            if (cur.Subtract(lastTime) > TimeSpan.FromSeconds(1))
            {
                int frameDiff = totalFrames - lastFrames;
                lastFrames = totalFrames;
                lastTime = cur;
                this.Title = frameDiff.ToString() + " fps";
            }
Notes: im1 is a image object set in xaml file
5 Download: https://sites.google.com/site/csjoublogfiles/home/files/KinectSDKEx1.zip

Microsoft Kinect for Windows SDK Beta from Microsoft Research(第一課)

Ref: http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/default.aspx
System: Windows 7 x86 + VS 2010
Kinect sensor
1. 安裝SDK含驅動程式。

2. 執行 Sample skeletal viewer
3. 辨識能力不錯(部分腳被遮蔽)

2011年6月8日 星期三

2011年6月6日 星期一

Facebook Winform API Test OK

1. Download Facebook C# SDK 5.0
1.1 SDK
1.2 Sample code

2. Create Facebook api to get ID
3. VS 2010 Open CSWinFormsAuthTool    fill app id in MainForm.cs
    //private string _appId = "{app id}";
    private string _appId = "2272280...";

4. Run App
5. Sample code   

2011年6月4日 星期六

Lesson 3 for Flex 4.5 (3D Rotating effect)

1. Open a Web project
2. Create assets folder and put into a picture file.
3. Copy cod
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
 <s:layout>
  <s:BasicLayout />
 </s:layout>

 <fx:Declarations>
  <s:Rotate3D id="rotate3DX"
     target="{image}"
     angleXFrom="0"
     angleXTo="360"
     duration="2000"
     autoCenterTransform="true" />

  <s:Rotate3D id="rotate3DY"
     target="{image}"
     angleYFrom="0"
     angleYTo="360"
     duration="2000"
     autoCenterTransform="true" />

  <s:Rotate3D id="rotate3DZ"
     target="{image}"
     angleZFrom="0"
     angleZTo="360"
     duration="2000"
     autoCenterTransform="true" />
 </fx:Declarations>

 <mx:ApplicationControlBar width="100%" cornerRadius="0">
  <s:Button id="buttonX"
      label="Rotate3D X-axis"
      click="rotate3DX.play();" />
  <s:Button id="buttonY"
      label="Rotate3D Y-axis"
      click="rotate3DY.play();" />
  <s:Button id="bButtonZ"
      label="Rotate3D Z-axis"
      click="rotate3DZ.play();" />
 </mx:ApplicationControlBar>
 <!--resizeMode="scale" -->
 <s:BitmapImage id="image"
       source="@Embed('assets/fx_appicon.jpg')"
       smooth="true"
       x="30"
       y="40"
       width="100"
       height="100" />

</s:Application>

4. Run project


5. Down load code

2011年6月3日 星期五

Lesson 2 for Flex 4.5 (Animation)

1. New Flex Web Project
2. Add animation instructions as follows:
<fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
  <!-- ref : http://seantheflashguy.com/flex/Flex3EffectsExample/srcview/index.html -->
  <mx:Sequence id="compEffect"  repeatCount="0"  repeatDelay="1500">
   <mx:Move xTo="200" />
   <mx:Move yTo="200" />
   <mx:Move xTo="100" />
   <mx:Move yTo="100" />
  </mx:Sequence>
 </fx:Declarations>
3. Add canvas
<mx:Canvas id="myCanvas"
      creationCompleteEffect="compEffect"
      x="100" y="100"
      width="100"
      height="100"
      backgroundColor="#0000ff"/>
4. Run the Project
5. Download code