windows-8

How save photo capture windows 8 c# metro app?

自古美人都是妖i 提交于 2020-01-05 07:49:13
问题 I looked everywhere but can't find how save my photo after I captured it. I use windows 8 media capture, and after I capture it, I show it on my page. But don't know how to save it to a particular place. This is how I take the photo, pretty classic: private async void Camera_Clicked(object sender, TappedRoutedEventArgs e) { TurnOffPanels(); CameraCaptureUI camera = new CameraCaptureUI(); camera.PhotoSettings.CroppedAspectRatio = new Size(16, 9); StorageFile photo = await camera

Display an Animated GIF in a Metro App

試著忘記壹切 提交于 2020-01-05 07:17:13
问题 Is there a control to show an animated gif in a Windows Store (Metro) app in Windows 8? I am using C# and XAML with databinding. 回答1: The Image control doesn't support animated GIFs. You will need to extract the frames and animate them on your own timer. You should take a look at this link which might help you regarding your question: http://advertboy.wordpress.com/2012/05/08/animated-gifs-in-xamlc/ 回答2: You cannot display an animated gif in a grid. However, you can display an animated gift

how to create gridview from dictionary

徘徊边缘 提交于 2020-01-05 07:09:16
问题 I have a dictionary where key is a String and element is a List I want to create a group from every key with elements from element. But I don`t know how to make it <Page.Resources> <!-- Collection of grouped items displayed by this page, bound to a subset of the complete item list because items in groups cannot be virtualized --> <CollectionViewSource x:Name="groupedItemsViewSource" IsSourceGrouped="true" /> </Page.Resources> <GridView ItemsSource="{Binding Source={StaticResource

Image rotation as animation

南笙酒味 提交于 2020-01-05 06:53:29
问题 I am making a Windows 8 application in visual studio 2012 c#. I am having an image '1.png' and I want to rotate it at any angle as an animation along its center point. But i want to do it with the help of c# code rather than XAML code. Thank You in Advance. 回答1: In your XAML, have the following image: <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Image Source="/Assets/Logo.png" Width="300" RenderTransformOrigin="0.5, 0.5"> <Image.RenderTransform> <RotateTransform x

Can a metro app open the default browser without opening a page?

戏子无情 提交于 2020-01-05 04:57:50
问题 On button click I want to open the default metro browser (usually IE) without opening a new tab/page, just open the browser, If it is already running then just switch to it as it is to it's current state. Is there a way to do that? 回答1: This is just something to try, and may or may not work in your scenario: If you know the url that is open in the browser, your Windows Store app could launch that same url with the launcher. In my app, when I launch the same url multiple times, IE will pop up

Binding to BitmapImage

孤人 提交于 2020-01-05 03:56:06
问题 public class Thumbnail : INotifyPropertyChanged { public BitmapImage testimage { get; set; } Thumbnail() { testimage = new BitmapImage(new Uri("http://www.diseno-art.com/news_content/wp-content/uploads/2012/09/2013-Jaguar-F-Type-1.jpg")); } } And a image element in a custom control: <Image x:Name="previewImage" x:FieldModifier="public" Margin="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="{Binding Path=thumbnail.testimage}" Stretch="Fill" /> When i create a control, i

How to subscribe to events raised within a Windows Runtime Component in C++/CX?

☆樱花仙子☆ 提交于 2020-01-05 02:54:11
问题 I have an class in a Windows Runtime Component (written in C#) that raises events. I cannot work out how to subscribe to these events in a C++/CX app that references the component. The C# code (in the Windows Runtime Component): public sealed class Messenger { private EventRegistrationTokenTable<EventHandler<MessageReceivedEventArgs>> messageReceivedTokenTable; public event EventHandler<MessageReceivedEventArgs> MessageReceived { add { return EventRegistrationTokenTable<EventHandler

Saving a BitmapImage object as a file in local storage in windows 8?

橙三吉。 提交于 2020-01-04 06:49:11
问题 I have a BitmapImage object, which already has its source etc set. I simply want to save it to my apps local storage folder, so that I can reference it at other points in the program. I just cannot figure out how to get it from object to file though! I've found solutions to similar problems for WP7, but its just not the same. Ive got as far as creating my image from a Base64 string (which works as I can load the image into a UI image viewer and see it) and have called it img , and I know I

Can I use objects created in C# within metro ui javascript code?

穿精又带淫゛_ 提交于 2020-01-04 06:23:49
问题 I really like C# and I am familiar with it, but I also want to use HTML5/JavaScript to manage the UI for my Windows 8 Metro app. So, how can I import and use objects from a library made in C# in the Javascript files? Example here is the starting JS code for an empty HTML5/JS project... // For an introduction to the Blank template, see the following documentation: // http://go.microsoft.com/fwlink/?LinkId=232509 (function () { "use strict"; var app = WinJS.Application; app.onactivated =

Using AppendTo/jquery-win8 in Win8 apps

≡放荡痞女 提交于 2020-01-04 03:38:12
问题 I am tempting to look at the ToDoMVC samples and have tried porting them to a Win8 JS app by just copying and pasting the code but also having the relevant WinJS libs referenced. Due to MS security principals around InnerHTML etc I have referenced jQuery-Win8 which attempts to get around the issue however in the Angular and Backbone examples when I run the app I get an exception on appendChild I've read in some places you should be able to continue running the app but if I do press Continue