Windows Phone 7 Archives

Formula to Convert CMYK to RGB values

It is possible to convert CMYK values to RGB values. We can see how to do this in the following section.

Consider the cyan, magento, yellow and black values of CMYK as c, m, y and k respectively. Now we can find the equivalent RGB values using the following formulas :

r = (1-k)-(1-k)*c;

g = (1-k)-(1-k)*m;

b = (1-k)-(1-k)*y;

Here, r, g and b will have the corresponding red, green and blue values.

Incoming search terms:

  • cggiuajq
  • converting cmyk values to rgb in ios
  • ios cmyk
  • phonegap OrientationChanged

Setting polygon properties dynamically in WP7

Following code snippet will create polygon and set properties dynamically:

Polygon polygon = new Polygon;

polygon.Points = new PointCollection()
{

new Point(150, 50),
new Point(10, 50),
new Point(50, 20)
};
polygon.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue);
polygon.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Red);
polygon.StrokeThickness = 3;
polygon.Opacity = 0.5;

The following code snippet will create a polygon dynamically:

Incoming search terms:

  • what is polygon in wp7

How to launch a URL in wp7.

To launch a url you can use the WebBrowserTask in windows phone 7.

The following code snippet allow you to change the background color of a hyperlink button in Windows Phone7 :

Dim scb As New SolidColorBrush()
scb.Color = Colors.Green
myHyperlinkButton.Background = scb

That’s it!

Incoming search terms:

  • how to dynamically make hypertextbutton in wp7
  • windows phone 7 button background color

Detecting device orientation in XNA in WP7

Whenever our phone physically changes orientation, the GameWindow.OrientationChanged event gets raised.

So the code to check the CurrentOrientation property in your game would be like following:

Incoming search terms:

  • xna windows currentorientation change ios

Script for sending email in Windows Phone app

The following script will help you to send email from your windows phone app:

  • EmailComposeTask emailComposeTask = new EmailComposeTask();
  •   emailComposeTask.Subject = “Send To Me”;
  •   emailComposeTask.To = Address.Text;
  •   emailComposeTask.Body = Message.Text;
  •   Message.Text = String.Empty;
  •   emailComposeTask.Show();

Incoming search terms:

  • emailcomposetask html

How to delete IsolatedStorageFile in WP7?

Below is the code for deleting IsolatedStorageFile in WP7:

public void DeleteTempFile(string fileName)
{
try
{
var storage = IsolatedStorageFile.GetUserStoreForApplication();
if (storage.DirectoryExists(“temp”) == false) return;

fileName = Path.Combine(“temp”, fileName);
if (storage.FileExists(fileName))
{
storage.DeleteFile(fileName);
}
}
catch (Exception) { }
}

Page 1 of 712345...Last »