Android camera no save/discard button - c#

I have been writing an application which uses the android camera object directly - not using the intent as I need more control over the resolution and other attributes. I occasionally have an issue where by although I can take a picture I do not get the save and discard buttons displayed. If I exit from the camera the last picture taken is returned to the calling activity but it is confusing as I need to process the photo and this does not work correctly unless save is clicked. A reboot of the phone seems to clear the problem but I would like to identify why this happens...

Related

Preventing UWP from shutting down by pressing ‘B’ button on XBOX – XAMARIN

There is a post in stackoverflow that covers my research in this matter so far: How to do job while the application is exiting in UWP?
I found this solution in several searches about the preventing UWP from closing and it works, I know I’ll have to ask for approval before I submit my app to Windows Store to use Restricted capabilities to use it, but it is ok.
But the point is: I’m writing an app to run in Android, iOS and UWP platforms, in UWP the ability of the user to close the app in a PC is quite alright but closing the app in XBOX by accidentally press button B in the Gamepad control is a very annoying issue that I want to prevent!
The post mentioned before cover the problem to UWP app in a pc, with is not an issue for me because if the user clicks the X in the up-right corner of the window it alright that the app closes, but if the user press B button of XBOX controller accidentally and the app closes immediately, it is a very rude event of user experience, and I want that out of my app.
So, the post I mentioned before works fine for a PC, but it does not work at all in an XBOX series S. My question is how can I solve this issue? I’m sure that is not a UFO thing because every game bought in the store have this issue solved!
How can I do the same?
I figure it out: preventing XBOX button B is about disable back button not about intercept a close request.
So, the only thing is needed to be done is to add:
protected override bool OnBackButtonPressed() => yes;
to the page where the back button is meant to be disables

How to programmatically add/modify/delete available display settings (width, height, refresh rate)?

I want to code (in C#) a tool to add/modify/delete some of the available Windows display configurations (width, height and refresh rate).
Can this be done programmatically? I've spent many hours trying to find something about this online but had no luck.
The reason i want it is because of some older full screen games that keep setting the refresh rate back to 60hz from whatever it were when the game started (120hz in my case). I can solve that problem using Alt-Tab twice but I rather want to just limit the available display configurations (or change the refresh rate for some of them) instead.
Before considering all this I've tried to solve my problem with these attempts:
Intercepting the keyboard (using this class Global keyboard capture in C# application) and then attempt a force display change when a hotkey it pressed. It works fine for just about all normal apps. But when a full screen game is running the keydown event doesn't fire. Either it is not possible when a full screen game has focus or I don't just know how to do it properly (very likely as I am a newbie in that regards).
Tried using a timer to periodically check for a certain resolution and if 60hz is detected then try to set it to 120hz. The timer does fire and the code tries to change the monitor (which flickers briefly) - but the refresh rate doesn't change.
Another idea I had was to use Mhook or Detours to intercept the 'change display setting'-call. But I don't know if that'll work. And I also have no experience with C++. So I really don't want to go that way if I can avoid it.
Can this be programmatically? I've spent many hours trying to find
something about this online but had no luck.
This settings are not part of the standard .Net Framework but there is interface to manipulate these settings for windows problematically using win32 APIs. you can look here on how to call windows APIs using .Net Framework. then you can call a windows API to change the resolution for instance.

How to delete delay on SendKeys.SendWait?

Hello I want to press a button with my app. So I use SendKeys class
SendKeys.SendWait("{RIGHT}");
Problem is that I need to wait 3-4 seconds after this line code for reaction from system. How can I speed it up or how can I delete this delay ?
// update 1
I've also tried
SendKeys.SendWait("{RIGHT}");
SendKeys.Flush();
BUt id didn't help
// update 2
I want my app that works in background to press a button programaticly in the actual active state of the user. So if he is in excel i want the right arrow to move the active cell, if he is in the game i want to turn right etc. SendWait does the thing I want but with some delay that I don't want.
Second important thing that this is not a virus or worm or anything like that. First of all as you can see I'm too stupid for that and secondly I'm playing with my KInect so this is some kind of interaction beetwen user and computer. Thats why it works in background and thats why I need to send it to the active app of the user
SendKeys is a nice little feature for Windows Form applications. Based on your tag it appears that you're using Windows Presentation Foundation, which will not support SendKeys.Send()
https://stackoverflow.com/a/1646568/340574
Take a look at the link above to use KeyEventArgs. I've read that you could also add a reference to System.Windows.Forms.dll through Visual Studio to use SendKeys, but I have not tried it myself.

Debug Secondary Tiles (attaching debugger)

How do you attach the debugger to the Windows Emulator (or Device) to debug runs from Secondary Tiles?
I'm created a secondary tile but it has some problems loading the data and I can quite figure out what is going wrong. How can i attach to the process so i can debug it?
Thanks for your help!
You can't. A click on a live-tile doesn't resume the previous instance, but creates a new one (or resets the navigation-stack, from a users perspective it's the same)
But considering that a Live Tile is nothing but a URI, I see no reason you need to click on the actual tile to test the functionality of such a URI. You could simply change the NavigationPage property of the DefaultTask in the WMAppManifest.xml, to be the URI your tile is meant to open with.
If you have a specialized functionality related to your tile, you should tell us, so we can give a more detailed answer.
This works for me...
Start app as normal
Tap Home
Tap second Live Tile
The debugger stays attached when the app closes (this allows testing of tombstoning etc) so it is still attached when you tap the second tile.

PowerPoint SlideShowSettings.Run() does not run embedded video

I have a C# application that runs on a computer connected to a large display in our cafeteria. The application pulls all the PowerPoint files out of a folder and runs each one as a slide show continuously. Everything was working fine until someone decided to insert a movie clip onto a slide. The problem is that the movie never starts. If open the presentation in PowerPoint and run the show it works, and if I right click on the presentation and click 'show' it works. Here is the code I am using to open the presentation and start the slideshow.
pres = app.Presentations.Open(pptPath, MsoTriState.msoTrue, MsoTriState.msoTrue, MMsoTriState.msoFals);
pres.SlideShowSettings.Run();
Is there something else I need to set to get the Run() method to also start movies?
Edit: The presentation in question only had one slide in it which contained the movie. If I added another slide to it, it worked fine. Also tried adding a slide before and had the same problem, so apparently the problem only exists for the last slide in the presentation.
The main issue here is that PowerPoint animations (video, audio, custom motion paths, etc.) will only play when the SlideShowWindow has the focus. What this means is that when you're running your app and launching PPT, your app still maintains the focus and hence animations don't run (that doesn't stop you from manually manipulating your running deck though).
There are a couple of ways around this:
You can call the API SetWindow to
bring your SlideShowWindow to the
front. Not a great way to do it in
my opinion.
The very easiest way is just to save
your .ppt/.pptx to a .pps/.ppsx
(PowerPoint Show). With that, you
can use your same code to run it and
it will launch and take the focus
automatically (and your animations [video, et al) will run as you've intended).
Found the problem. I had a thread.sleep statement in the presentation's app_SlideShowNextSlide event handler that handled the end of one slideshow and starting the next. I wasn't thinking at the time and this code was running in the same thread at the slideshow itself. I created a timer object instead and moved the necessary code into the timer's elapsed event handler.

Categories

Resources