Geeks With Blogs
Prabhu Kumar a tech twaddler.. Applications
Windows Phone 7: Translation, rotation, scaling and the effect of ‘BitmapCache’ on performance
I just published a post on my blog at http://www.techtwaddle.net, here is the link: http://techtwaddle.net/2011... ......

Posted On Thursday, March 10, 2011 2:38 AM

Windows Phone 7: Building a simple dictionary web client
Like I mentioned in this post a while back, I came across a dictionary web service called Aonaware that serves up word definitions from various dictionaries and is really easy to use. The services page on their website, http://services.aonaware.co... lists all the operations that are supported by the dictionary service. Here they are, Word Dictionary Web Service The following operations are supported. For a formal definition, please review the Service Description. Define ......

Posted On Thursday, December 30, 2010 1:06 AM

Windows Phone 7 : Dragging and flicking UI controls
Who would want to flick and drag UI controls!? There might not be many use cases but I think some concepts here are worthy of a post. So we will create a simple silverlight application for windows phone 7, containing a canvas element on which we’ll place a button control and an image and then, as the title says, drag and flick the controls. Here’s Mainpage.xaml, <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition ......

Posted On Sunday, December 19, 2010 10:18 PM

Windows Phone 7 : UI Control Boundaries
I was working on an application at work when I needed to figure out a really trivial case, well, trivial in theory at least. All I wanted to know was if a button was completely inside a rectangle. Could anything else be simpler you think. Just check the button bounds against the rectangle bounds, pseudocode if (Button.Top > Rectangle.Top && Button.Left > Rectangle.Left && Button.Right < Rectangle.Right && Button.Bottom < Rectangle.Bottom) { //Button is inside rectangle ......

Posted On Monday, November 22, 2010 11:37 PM

Edit boxes and default text selection
While working on an application of mine, I had to display ‘Help’ information. I chose to use a read-only multiline edit box along with SetWindowText() to display the text, sounds simple enough. But I ran into a small but annoying problem. The text displayed was all selected, and I thought why would the text be selected by default!? Here is a sample program to demonstrate this, #include <windows.h> #include <aygshell.h> #include "resource.h" HINSTANCE g_hInst; BOOL CALLBACK EditBoxSelTextDlgProc(HWND, ......

Posted On Friday, August 20, 2010 7:39 PM

HTC HD2, Accelerometer and Windows Phone 7 – Source Code
If you haven’t seen the video demo in my last post, I suggest you watch it first to get a better understanding. So in this post we are going to see how the WCF service, the .NET Compact Framework application running on HD2 and the Silverlight application running on the Windows Phone 7 emulator work together. The Objective We are going to write three applications, a simple WCF service hosted in a windows console application which implements two functions, one called UploadAccelData() and the other ......

Posted On Sunday, August 1, 2010 10:56 PM

Shake detection on HTC HD2
In the previous post I mentioned that the acceleration vector or the force vector can be used to detect gestures like shake. Here is a crude implementation of shake detection, private const double SHAKE_THRESHOLD = 5.0f; private bool IsShakeDetected(HTCSensorData sensorData) { bool isShake = false; double x = (double)sensorData.tiltX / 1000; double y = (double)sensorData.tiltY / 1000; double z = (double)sensorData.tiltZ / 1000; double forceSqrd = x * x + y * y + z * z; System.Console.WriteLine("F... ......

Posted On Saturday, July 24, 2010 5:53 PM

Applications: The Mathematics of Movement, Part 3
Previously: Part 1, Part 2 As promised in the previous post, this post will cover two variations of the marble move program. The first one, Infinite Move, keeps the marble moving towards the click point, rebounding it off the screen edges and changing its direction when the user clicks again. The second version, Finite Move, is the same as first except that the marble does not move forever. It moves towards the click point, rebounds off the screen edges and slowly comes to rest. The amount of time ......

Posted On Saturday, June 12, 2010 7:32 PM

Applications: The Mathematics of Movement, Part 2
In part 1 of this series we saw how we can make the marble move towards the click point, with a fixed speed. In this post we’ll see, first, how to get rid of Atan2(), sine() and cosine() in our calculations, and, second, reducing the speed of the marble as it approaches the destination, so it looks like the marble is easing into it’s final position. As I mentioned in one of the previous posts, this is achieved by making the speed of the marble a function of the distance between the marble and the ......

Posted On Sunday, June 6, 2010 1:53 PM

Applications: The Mathematics of Movement, Part 1
Before you continue reading this post, a suggestion; if you haven’t read “Programming Windows Phone 7 Series” by Charles Petzold, go read it. Now. If you find 150+ pages a little too long, at least go through Chapter 5, Principles of Movement, especially the section “A Brief Review of Vectors”. This post is largely inspired from this chapter. At this point I assume you know what vectors are, how they are represented using the pair (x, y), what a unit vector is, and given a vector how you would normalize ......

Posted On Sunday, May 23, 2010 11:30 AM

Copyright © TechTwaddle | Powered by: GeeksWithBlogs.net