I'm just starting developing with Kinect version 2 (SDK 2.0) and am trying out a windows store app with kinect support. I've followed one of microsoft's videos in order to set up basic interactions with a grid app. You add the following lines of code in the App.xaml.cs file:
KinectRegion region = new KinectRegion();
KinectUserViewer viewer = new KinectUserViewer() {
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom,
Width = 121,
Height = 100
};
Grid grid = new Grid();
grid.Children.Add(region):
grid.Children.Add(viewer);
region.Content = rootFrame;
Window.Current.Content = grid;
I'm getting no error reports or exceptions and the user viewer comes up fine. There are no interactions however. Whatever I do I cannot get the hand icon to appear on screen like in the demo.
Any help or suggestions as to what's going wrong would be much appreciated.
P.S. I'm new to windows development, I have an Apple background.
I know you asked this a month ago, but have you turned on the Microphone and Webcam features in your Package.appxmanifest file? It's under the Capabilities tab.
Related
Summary
If the contents of a Frame spill over the edge and if the frame has a border, the frame's border draw on top of the contents on iOS, but below the contents on Android. Is it possible to make the iOS border draw below the contents?
Details
I suspect this may be a bug in Xamarin.Forms, or maybe even the expected behavior on iOS, but nonetheless it is causing problems in my application visuals so I'd like to fix it if possible.
The following code reproduces the problem:
var frameInstance = new Frame();
var grid = new Grid();
AbsoluteLayout.SetLayoutBounds(frameInstance, new Rectangle(58f, 103f, 222f, 304f));
AbsoluteLayout.SetLayoutFlags(frameInstance, AbsoluteLayoutFlags.None);
frameInstance.WidthRequest = 222f;
frameInstance.HeightRequest = 304f;
frameInstance.IsClippedToBounds = false;
frameInstance.HasShadow = false;
frameInstance.CornerRadius = 10;
frameInstance.BorderColor = Color.Gray;
absoluteLayout.Children.Add(frameInstance);
grid.HeightRequest = 42f;
grid.Margin = new Thickness(-32, -32, 0, 0);
grid.HorizontalOptions = LayoutOptions.Fill;
grid.VerticalOptions = LayoutOptions.Start;
grid.BackgroundColor = Color.Red;
frameInstance.Content = grid;
Notice that the frame is hosted in an AbsoluteLayout, but this is not necessary, it can be hosted in any top-level layout object in the page. The important thing is that the frame is offset from the top-left of the page so the contents of the frame can spill over and be seen clearly.
When running On iOS, the code above produces the following image:
If the code is run on Android, it produces the following image:
Is it possible to somehow suppress the rendering of the iOS frame on top of the contents, perhaps through a renderer?
The reason I need to solve this is because my app's login page has an icon which sits halfway over a frame, as shown in the following image (on iOS):
I am trying to show 4 icons for 4 tabs in the bar of my FreshTabbedNavigationContainer using FreshMVVM and Xamarin.Forms of course, they look as they should when I execute the app on an Android emulator, but when I use my Mac and emulate the app on an IOS emulator, these icons become gargantuan, just as you see in this picture.
Here is my code:
FreshTabbedNavigationContainer Code:
private static FreshTabbedNavigationContainer TabbedPageContainer = null;
TabbedPageContainer = new FreshTabbedNavigationContainer(navigation.ToString());
Products = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconHomeInverted.ico", null);
Discover = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconMagnifyingGlassInverted.ico", null);
Account = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconUserInverted.ico", null);
Settings = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconSettingsInverted.ico", null);
#region UI
//Dissables swipe only in android because in IOS can not be done
TabbedPageContainer.On<Xamarin.Forms.PlatformConfiguration.Android>().SetIsSwipePagingEnabled(false);
TabbedPageContainer.BarTextColor = Color.FromHex("#FFFFFF");
#endregion
page.CoreMethods.SwitchOutRootNavigation(navigation.ToString());
My icons are located in "MyProject.IOS", they are not in the resources folder or anything like that.
That is all, if you need more information I will provide it as soon as I see your request. I hope all of you have a great day.
Ok, I solved it, my icons were 500x500 aprox, on Windows, visual studio or fresh MVVM resize the image to fill the tabbed bars; this does not happen on Mac, so they were showing their actual size, I resized them to 38x38 and now they look like what I was looking for.
The iOS "Human Interface Guidelines" have suggested sizes for the custom icons in the Navigation Bar.
These sizes go from 24px to 28px for the #1x scale factor meaning that for the other scale factors we will have something like:
24px
48px#2x
72px#3x
28px
56px#2x
84px#3x
Of course, you are capable of adjusting these numbers to keep consistency across your application.
More information about this here
Hope this helps.-
I'm working on an application for home based users. And this application involves completely replacing windows explorer for a custom application.
I would like to mimic the behavior of the taskbar. For example, when you click the maximize button in Notepad, it does not overlap the taskbar.
I already tried to use the api to AppBar however, AppBar api does not work when windows explorer is not running and other windows overlap my taskbar.
Any idea how I can do this? If I can restrict the size of maximized windows when ever helps me. The problem is that other applications are not always written by me.
I found an example using an win32 api SystemParametersInfo.
This way I can define an area where the other applications will fit and leave an space to my form even if other applications is maximized.
Link on github
public static void MakeNewDesktopArea()
{
// Save current Working Area size
m_rcOldDesktopRect.left = SystemInformation.WorkingArea.Left;
m_rcOldDesktopRect.top = SystemInformation.WorkingArea.Top;
m_rcOldDesktopRect.right = SystemInformation.WorkingArea.Right;
m_rcOldDesktopRect.bottom = SystemInformation.WorkingArea.Bottom;
// Make a new Workspace
WinAPI.RECT rc;
rc.left = SystemInformation.VirtualScreen.Left + 150;
rc.top = SystemInformation.VirtualScreen.Top; // We reserve the 24 pixels on top for our taskbar
rc.right = SystemInformation.VirtualScreen.Right;
rc.bottom = SystemInformation.VirtualScreen.Bottom - 101;
WinAPI.SystemParametersInfo((int)WinAPI.SPI.SPI_SETWORKAREA, 0, ref rc, 0);
}
I have made a C# Windows Forms Application in Visual Studio 2012 and added dlls from this webpage: http://vlcdotnet.codeplex.com/
I have already gotten video to work with this code:
VlcControl player = new VlcControl();
Vlc.DotNet.Core.Medias.MediaBase media = new
Vlc.DotNet.Core.Medias.PathMedia(#"path\movie.avi");
player.Media = media;
player.Play();
But that displays it in another window and I have no control over that. How would I embed the video in my form?
I have not found any documentation on how to do this programmatically. Most people in tutorials have some sort of vlc control listed in their toolbox, but I haven't, so I would need to do that with code.
I have tried using panel as VlcControl's parent:
player.Parent=panel1;
Movie still plays, but there is no video, only sound.
What kind of container should I use and how to make it show the video?
More information:
Here: VLC.DotNet Control Hosted in WPF it is said that it is possible to embed video inside WindowsFormsHost element in WPF. However, in Windows Forms Application, there is only ElementHost available to me. Could I use that to embed videos and if yes, how?
I have found the solution. I needed to add player to panel's controls and set the player size. Here it is, if anyone will ever need it:
player = new VlcControl();
panel1.Controls.Add(player);
player.BackColor = System.Drawing.Color.Black;
player.ImeMode = System.Windows.Forms.ImeMode.NoControl;
player.Location = new System.Drawing.Point(0, 0);
player.Name = "test";
player.Rate = 0.0F;
player.Size = new System.Drawing.Size(1024, 768);
Vlc.DotNet.Core.Medias.MediaBase media = new
Vlc.DotNet.Core.Medias.PathMedia(#"path\movie.avi");
player.Media = media;
player.Play();
I am newbie to windows phone development.
I have created the progress indicator using following code .
ProgressIndicator progressIndicator = new ProgressIndicator();
progressIndicator.IsVisible = true;
progressIndicator.IsIndeterminate = true;
SystemTray.SetProgressIndicator(this, progressIndicator);
It is working fine. But it is coming in the top of display. I want to place it in center of display. How to do this ?
The Windows Phone SDK has an progress bar control which can be placed into any place of the page. But this control has weak performance to avoid this weakness you should use PerformanceProgressBar control from the Silverlight for Windows Phone
You can create a custom progress bar. That way you can define the control template as you would like. The following link should get you started:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/gg442303(v=vs.105).aspx
or you can override the control template of the standard ProgressIndicator, though I believe the performance of this control is quite poor.