Posts tagged Microsoft Surface
Change screen orientation of a Microsoft Surface application
Nov 3rd
Microsoft Surface is designed to allow MultiUser and MultiTouch interaction.While MultiTouch is easy to acknowledge, the MultiUser and designing a smart changing of Surface’s screen orientation is a little difficult coming from desktop computing, where the monitor’s down will be the same always.
In order to understand the need of changing the screen orientation on a Microsoft Surface, you might want to think about it’s normal usage: Collaboration and User experience. In the implementation for a group of 4-8 people, sitting around the Surface, their need for rotating the environment is almost zero or otherwise they will experience dizziness and losing their focus while rotating the environment for one of them.
While for the situation in which you have casual visitors(as in BMW implementation in their showrooms), who sit in pairs working on one Surface, you might considering rotating the window such that the ’Down’ of the application would be the nearest edge to them.
How to make a Print Screen on Microsoft Source using WPF
Nov 1st
After we took a look inside of Microsoft Surface, let’s see how to take a later look on the surface, by creating printscreens of the application.
In some WPF applications you’ll need to take a quick screenshot of the user’s screen, allowing him (or them, in case of Multi User Surface) for later reviewing. Now, on Surface there can be only one full screen and active application. So it use the entire screen of the device.
Here are the steps in order to accomplish that:
First, we need to add to Visual Studio project the references to the libraries that we’ll use:
using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms;
Then, we will add create the method that will do the actual saving to a specific file, with the format PNG:
public void MakeScreenshot(String fileName)
{
Bitmap bmpScreenshot;
Graphics gfxScreenshot;
//first, we create&set a bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
//Using the bitmap, we create a graphics object
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
//Copy the rectangle (the screen in our case) - from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Do the saving, outputing a file by supplying the name and format it as PNG
bmpScreenshot.Save(fileName, ImageFormat.Png);
}
That’s all, folks – Use and enjoy!
C# .Net using Post with HTTPWebRequest
Aug 8th
Just a reminder for posterity : posting with .Net its so easy! Check out the Cocoa touch framework to realize the difference!
public string Post(string url, string data) {
string strReturn = null;
try
{
//Encoding the post vars
byte[] buffer = Encoding.ASCII.GetBytes(data);
//Initialisation with provided url
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(url);
//Set method to post, otherwise postvars will not be used
WebReq.Method = "POST";
WebReq.ContentType = "application/x-www-form-urlencoded";
WebReq.ContentLength = buffer.Length;
Stream PostData = WebReq.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
//Closing is always important
PostData.Close();
//Get the response handle, we have no true response yet
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
//information about the response
HTTPStatusCode status = WebResp.StatusCode;
string server = WebResp.Server;
//read the response
Stream WebResponse = WebResp.GetResponseStream();
StreamReader _response = new StreamReader(WebResponse);
strReturn = _response.ReadToEnd();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return strReturn.Trim();
}
Enjoy!
Microsoft Surface – What’s inside
Aug 1st
After starting the task, I started to be very curios about the technology that drives this device.I started looking over the internet and I found this picture. Very interesting, isn’t it? Basically contains a normal computer, linked to a projector and few infrared cameras.
1) Screen, the visual part of the device – Contains a special diffuser which turns the Surface’s acrylic tabletop into a big horizontal “multitouch” screen, capable of acquiring and processing multiple inputs from multiple users in the same time. The Surface is far more advanced than simple multitouch devices, being capable to be aware of different objects by recognizing their shape or by reading coded “domino” tags when placed on the table.
Microsoft Surface – new task and new challenges
Jul 29th
New day, new task, new challenges – Today I started working on a social collaborative tool which will work on Surface, but extended eventually to Flex 3, Silverlight and iPhone.
First impression: Visual Studio is an old friend. Still, bad news: Surface SDK is kept locked in a website, having access only those who bought a license. Shame, Microsoft!
After installing the SDK I started running the examples, I noticed that many events are new, a lot of new interaction techniques appeared ( the device can track up to 50 different fingers) and also the trackers who can be identified and corresponding menus, actions, interactions can be setup.
I’m looking forward to this new style of programming and really hope to learn it as fast as Objective-C.
Euro
Lira sterlina
Dolar SUA
Francul elvetian
Gramul de aur



