windows-runtime

Getting Selected Item information from ListView in WinRT

China☆狼群 提交于 2019-12-13 07:06:07
问题 I have the following code which popualtes a ListView with photos from Flickr private async void ParseFlickrResponse(HttpResponseMessage response) { XDocument xml = XDocument.Parse(await response.Content.ReadAsStringAsync()); var photos = from results in xml.Descendants("photo") select new FlickrImage { ImageId = results.Attribute("id").Value.ToString(), FarmId = results.Attribute("farm").Value.ToString(), ServerId = results.Attribute("server").Value.ToString(), Secret = results.Attribute(

WinRT C++ (Win10), opencv HSV color space, image display, artifacts

ⅰ亾dé卋堺 提交于 2019-12-13 06:47:24
问题 My goal is to make an object tracking. I have a UWP c# app and linked c++ windows runtime component. There I can obtain acces to opencv. In c#, MediaCapture return SoftwareBitmap. Then I pass SoftwareBitmap to c++ and convert it to opencv's Mat. Then cvtColor(cvFrame, cvFrame, COLOR_BGR2HSV); And then convert back to SoftwareBitmap, with BitmapPixelFormat::Bgra8 ( only Bgra8 is accepted by Software Bitmap ) and BitmapAlphaMode::Ignore And there is what I've got screen If I skip a cvtColor

Erasing the content from canvas where mouse is being dragged

痞子三分冷 提交于 2019-12-13 06:20:49
问题 I am developing a paint like application in metro style. I want to apply a eraser functionality. So how can I make such a tool for erasing the content from canvas like we do in MS paint ? I don't want to clear whole canvas, wherever I click or drag the pointer, the path traveled by the pointer should be erased. 回答1: The important thing to remember is that you're not "erasing." You're painting with small while pixels over the area that the mouse has traveled. There's 100 different ways to do

ScrollViewer: Disable Snap (elastic band effect)

大兔子大兔子 提交于 2019-12-13 06:19:38
问题 I have a ScrollViewer on my MainPage that contains all other elements (except the AppBars of course). Scrolling works fine, but I want to disable the snap behavior (you drag the whole page to the left, release it and it will snap back). See the image (Background of ScrollViewer: Black, Background of Grid: White). So how can I disable this behavior? Also known as overscroll or bounce effect. I just found out about IsScrollInertiaEnabled , but setting this to false doesn't help. <ScrollViewer

Find out which Style Resource a Control uses

徘徊边缘 提交于 2019-12-13 06:18:48
问题 I'm searching for a way to find out which style resources a control uses. I.e. I'm currently trying to change the Brushes of the back Button in my app. Confusingly these brushes are partly located under the ResourceKey s AppBarItemPointerOverForegroundThemeBrush (etc.) instead of BackButtonPointerOverForegroundThemeBrush (which doesn't seem to change anything - side question: what's this resource for?). I couldn't find the the foreground theme brush resource for the normal ViewState at all.

GridView width inherited from parent

与世无争的帅哥 提交于 2019-12-13 06:15:51
问题 I have a StackPanel with a fixed width. Inside that StackPanel I have a GridView , which Width should be limited to its parent width (smth like Width="*"). My sample XAML: <StackPanel Orientation="Horizontal" Width="300" Height="300"> <TextBox Width="50" Margin="0" Height="50" Background="Blue"></TextBox> <GridView > <GridView.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Orientation="Horizontal" FlowDirection="LeftToRight" /> </ItemsPanelTemplate> </GridView.ItemsPanel> <GridView.Items>

How do I handle KeyDown event in WinRT App (XAML and C#) which has a webview?

浪尽此生 提交于 2019-12-13 05:47:12
问题 public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); Uri mapUri = new Uri(@"http://www.google.com"); oneView.Navigate(mapUri); } protected override void OnNavigatedTo(NavigationEventArgs e) { //Focus(FocusState.Programmatic); //this.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(Window_KeyDown), true); Window.Current.CoreWindow.KeyUp += Window_KeyUp; Window.Current.CoreWindow.KeyDown += Window_KeyDown; } void Window_KeyUp(Windows.UI.Core

Save Image using FileSavePicker

自古美人都是妖i 提交于 2019-12-13 05:27:26
问题 I have an image displayed in an Image Control and I need to save that Image using FileSavePicker This is what I have done: Dim fileSavePicker As New FileSavePicker() fileSavePicker.FileTypeChoices.Add("PNG", New String() {".png"}) fileSavePicker.FileTypeChoices.Add("JPG", New String() {".jpg"}) fileSavePicker.FileTypeChoices.Add("BMP", New String() {".bmp"}) fileSavePicker.FileTypeChoices.Add("TIFF", New String() {".tiff"}) fileSavePicker.FileTypeChoices.Add("EXIF", New String() {".exif"})

How to design words balloon in WinRT XAML?

你离开我真会死。 提交于 2019-12-13 05:19:08
问题 I am trying to create words balloon looks like below image. How to design words balloon in WinRT XAML? Thanks. balloon image <Grid Width="400"> <Grid.ColumnDefinitions> <ColumnDefinition Width="22*"/> <ColumnDefinition Width="5*"/> </Grid.ColumnDefinitions> <Image Source="{Binding Image}" Margin="10,2,10,0" Grid.Column="2" VerticalAlignment="Top" /> <Border BorderBrush="Black" BorderThickness="3" HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="4"> <TextBlock

Which Httpclient is better in WinRT development?

元气小坏坏 提交于 2019-12-13 05:14:38
问题 In my progress of winRt development i find that I can use both of the two HttpClient: System.Net.Http.HttpClient windows.web.http.httpclient What's the difference and how can i choose one? 回答1: You should be using windows.web.http.httpclient for WinRT development as stated here. Note The System.Net.Http and System.Net.Http.Headers namespace might not be available in future versions of Windows for use by Windows Store apps. Starting with Windows 8.1 and Windows Server 2012 R2, use Windows.Web