I would like to add an overlay to the camera.How can it be done in xamarin forms
The ultimate answer is always that you can write a custom renderer for your camera control and add the overlay using you platform native capabilities.
For a Xamarin.Forms solution that doesn't involve custom renderers it is important to know what camera control you are using to begin with.
If you are using the XLabs camera control you could inject your custom MediaPicker.cs directly after registering the service.
A customrenderer is the answer. You could easily use AVFoundation, see this blog post that got me going https://blog.xamarin.com/how-to-display-camera-ios-avfoundation/.
I did this by creating a custom control following the steps in this link: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/view
It's very basic and you'll need to add more things to have a full usable camera, but it's a good start.
There is a discussion around the focus for that camera in here: Camera Using custom Camera Preview Renderer is not clear
Related
I am using Xamarin.Forms and trying to achieve the next layout:
I want to keep the native look and feel for each platform (i.e: iOS tabs will be shown in bottom.), I just want to add an extra image on top of the tabbed view. I have been looking around and can't find any one providing a way for this to work. I just want to make sure and ask if this is actually doable in Xamarin.Forms while maintaining native look and feel for all platforms?
Is not possible (using Xamarin Forms) to do this. TabbedPage is a Control that fills the entire display.
Here there is a interesting discussion about "TabView".
I think you can use some other controls to try to do the same thing. For example, buttons + CarouselView.
Otherwise on GitHub there are some guys that have tried to implement what you need.. TabView
I have a Entry Control on Xamarin.forms, I want to make this Entry to display auto complete values? Is that available on Xamarin.Forms?
Xamarin Forms Labs (XLabs) has an AutoCompleteView, the XLabs package is not being maintained going forward, but you could use it as guidance to make your own.
https://github.com/XLabs/Xamarin-Forms-Labs/wiki/AutoCompleteView
To do that I'm using the SFAutoComplete plugin, it have a lot of features to customize your autocomplete, you can see it here:
https://help.syncfusion.com/xamarin/sfautocomplete/overview
https://www.syncfusion.com/products/xamarin/autocomplete
Is there a way to change the image of the pins in Xamarin Forms Maps. I want to make the pin a custom image, if it has to be done natively, can someone give me a simple example of it. Thank you.
To anyone coming to the later, this is now well supported in Xamarin Forms.
In essence you need to create a custom map class in your PCL or shared code that inherits from the Xamarin Forms Map and then create a Custom Renderer in each of the platforms' projects.
Those custom renderers will be different for each platform, dealing with the specifics of rendering icons and any pop up information shown when you click on that pin for that particular platform. You are not obliged to create a custom renderer for all platforms, for any that you don't a normal map will be displayed.
This is all now really well documented in the Custom Renderers | Customizing a Map section of the Xamarin Forms Developers Guide. That documentation walks through creating a custom renderer for Android, iOS and UWP and explains the code needed in detail. There's a lot of it, so I won't reproduce it here. There is also an accompanying sample solution here.
One point worth noting is that if you are trying to reproduce that code in your own project you will also need to add the images in the various drawable folders in the ProjectName\Droid\Resources directory, and also the two axml files in the layout directory.
Apparently this is quite locked down and you have to look at custom renderers to achieve what you are needing.
There is a discussion about this on the following link:-
http://forums.xamarin.com/discussion/17916/customization-of-xamarin-forms-maps-pins
, with specific reference to a project at the following link which someone has implemented custom image pins from the Assets folder:-
https://github.com/paulpatarinski/ShouldIWashMyCar/blob/master/Android/Renderers/MapViewRenderer.cs
I haven't tried this yet, however this would probably be a good place to start when looking to customize map rendering.
This project might be helpful to you. raechten/BindableMapTest
From the description:
Small sample for binding a collection to a Xamarin Forms Maps pins
(valid until binding directly to the Pins property will be supported
by Xamarin Forms directly).
Includes custom and clickable pins.
It has Android and iOS implementations.
I am doing a flex application, I would like to include a box where the user can freely draw in the box, like a html canvas type thing but in my flex project. Is there any way of implementing this?
Yes; this site has a simple example that should help you.
I want to play a video (with sound) in a simple GUI with "play" and "stop" buttons etc. There are classes and widgets in Qt's Phonon module for doing that, and several examples. OK, so that seems to be simple.
But now I need to draw some custom graphics (that depend on the current time in the video) on top of the streamed video image. I have not found anything about this in the Qt documentation. What's the canonical way of doing this? Do I just create a custom VideoWidget widget and override its paintEvent? In another question here, some guy seemed to have trouble with this.
Any pointers would be appreciated.
Use QGraphicsView and QGraphicsWidgets. You can put your Phonon::VideoWidget inside a QGraphicsProxyWidget and it becomes usable as a QGraphicsWidget.
For custom overlays, inherit QGraphicsWidget and override the paint function to draw your custom widgets. You can add them to your scene and they will appear on top of your video widget.
Your solution cannot work because you cannot add a QGLWidget to QGraphicsProxyWidget. Please look at
http://doc.qt.digia.com/qt/qgraphicsproxywidget.html
Note that widgets with the Qt::WA_PaintOnScreen widget attribute set
and widgets that wrap an external application or controller cannot be
embedded. Examples are QGLWidget and QAxWidget.
Please correct me if I'm wrong.