Showing posts with label mango. Show all posts
Showing posts with label mango. Show all posts

Thursday, March 29, 2012

Windows Phone 7 Development Using Visual Studio 2010

with David Kelley and AppDev

Windows Phone 7 is a new step for Microsoft for the mobile platform. This course will introduce the mobile OS and how easy it is to use the.NET knowledge to create applications. The course will cover many introductory aspects of developing applications for the Windows Phone 7. For instance how XAML is used for applications and GUI designs. Also the course will cover many other aspects including controls, user input and forms, working with data, layout and Metro Controls. The course will also cover phone resources such as the Camera, GPS and many other items. To wrap up the course, the publishing the application to the marketplace and hosting of advertisements are covered.

In this course, you will learn:

* How to debug a phone application using an emulator
* About the PhoneApplicationPage and the PhoneApplicationFrame
* How layout controls are used including Grid, Canvas and Stackpanel
* Metro Basics and Phone Metro Controls
* About TextBlock, TextBox and other Form Controls
* What is touch eventing and working with events
* How MVVM (Model-View-ViewModel) works and learn how to use an asynchronous service in MVVM
* About lifecycle/tombstoning events including launching, deactivated and others
* Using media (Sound and Video) with the MediaElements and XNA Sound API's
* How to work with Bing Map Controls and Geolocation (GPS) Services

learn more at: http://www.appdev.com/prodfamily.asp?catalog%5Fname=AppDevCatalog&category%5Fname=W7DProduct&cookie%5Ftest=1#outline

Monday, December 12, 2011

Turning XAML into an image (jpg) in WP7 isolated storage and to the Phone Media Library

So one thing that has been kind a trick since the old avalon then wpf days was to be able to can a snap shot of part of the visual tree and make that an image so that you can clean up the visual tree from some xaml complexity and replace it with a plain image. I ended up trying todo with with my princess paper dolls app and found that its not as straight forward as wpf used to be but this works well enough with only a few lines of code. To start with you need to covert the UIElement root you want to turn into an image or rather a bitmap like this:

WriteableBitmap bitmap = new WriteableBitmap(480, 800);
bitmap.Render(master_03_14_2011, null);
bitmap.Invalidate();

So in this case 'master_03_14_2011' is the name of my canvas that holds the 'princess' in the app 'princess paper dolls'. Next I need to create a file name and convert the bitmap and store it to isolated storage


String FileName = String.Format("PrincessPaperDoll_{0:yyyy-MM-dd_hh-mm-ss-tt}.jpg", DateTime.Now);

var myStore = IsolatedStorageFile.GetUserStoreForApplication();
if (myStore.FileExists(FileName))
{
myStore.DeleteFile(FileName);
}
IsolatedStorageFileStream MyFileStream = myStore.CreateFile(FileName);

StreamResourceInfo sri = null;
Uri uri = new Uri("Princess;component/" + FileName, UriKind.Relative);
sri = Application.GetResourceStream(uri);
bitmap.SaveJpeg(MyFileStream, int.Parse(master_03_14_2011.Width.ToString()), int.Parse(master_03_14_2011.Height.ToString()), 0, 85);

ok so also we checked to see if the file exists before we try to write it and delete the old version. granted given how I'm creating the name its still kind of scares me to risk it. Next we do some clean up:

MyFileStream.Close();

Yes that was easy but now we need to use that stream again to get the image into the media library. First we create a stream again from the file in isolated storage.

MyFileStream = myStore.OpenFile(FileName, FileMode.Open, FileAccess.Read);
.

Now we can save it to the media library either to saved pictures or to the camera roll.

MediaLibrary library = new MediaLibrary();
Picture pic = library.SavePicture(FileName, MyFileStream);
//Picture pic = library.SavePictureToCameraRoll(FileName, MyFileStream);
MyFileStream.Close();

and some clean up and your good. unfortunately as of late there is no way to open up to the image in the media library.

Friday, November 4, 2011

APPortunties for Mango WP7 App's

So there is a group of Silverlight/Phone 7 insiders helping with this contest to win some samsung slates running windows 8 and some free advertising for an app of your choice. There was a contest like this a few months back and certainly the free advertising helped me with my zillion apps so I'm hoping to win my self so you better get to it or I'll win (not that this would be bad ). Basically gets some Mango (also known as Windows Phone 7.5 apps into the market place, and no this doesn't count apps already in the market place and then go the link on this image blow and enter the super secret code: DKELL