Movable Images on Xamarin Forms - c#

I am trying to make an app on xamarin forms in C# where the user can click on an image and then click on one of seven places and the image will move to the place that was clicked on. I've tried using the TranslateTo functionality of images but that does not seem to work. I also tried using Skia Sharp to create bitmaps becuase they have an intuitive coordinate system but I don't know how to make the SKBitmaps clickable. Is there a way, using skia sharp or not, to make clickable images that can be moved according to an intuitive coordinate system?

It is possible to do it in SkiaSharp, but you have to handle your touch input/gestures on your SKCanvasView - translate them into touch input/gestures to your primitives within SKCanvasView, then change position of your primitives according to your logic and finally refresh your SKCanvasView.

Related

Xamarin Forms is it possible to make different shapes for buttons or must I use imagebutton?

I really want to know if it's possible to make the custom shapes of a button to be the same as in the image, or must I use images?
The reason I don't want to use images is due to making sure they're properly scaling on each device where adding a custom button with text on top will always scale correctly to the device size.
After doing some research I couldn't find anything on this as I'm assuming this is another impossible thing that Xamarin.Forms don't support. Or potentially its possible with creating custom renderers?

How do i programmatically create a kind of arrow that points to the buttons like a flow

I am creating an Accounting software on C# WPF and I want this kind of arrow pointing to buttons like a flow structure in the picture.
And want that to be responsive.
I tried using png images of different sizes to show but its very hard and a lot of hard codes and some don't work as expected.
Please tell me a way to create it.
I know path class little bit but don't know how to make resize according to the screen size

How to rotate a panel in Windows Form using C#

This feels like it should be much easier to do than it is, but I've researched every link I could find and nothing works.
I'm trying to make an application for digital drawing. It floats above photoshop and appears with the middle click and gives me easy access to shortcuts, so it needs to be able to rotate 90 degrees for when I using my tablet landscape vs portrait.
The closest I got used bitmaps but of course then I can't press the buttons. Nothing using OnPaint and e.Graphics.Rotate and Matrixs have worked but I"m not sure if they were even supposed to work in this instance.
Apparently this is easy to do in WPF but I'm not going to rebuild it again for what would be the 4th time. If there is no way to cleanly rotate it (for some silly reason) then I'll probably just have to make an algorithm for switching the button functions and images and rotating them, or just duplicating the form and making rotated icons. Either way it's a big pain for what feels like what should be a base functionality.

Drawing a lot of lines and other shapes in WinRT App

In my WinRT app I need to draw about 3000 objects on a canvas, where I can translate and zoom the view. Unfortunatley, after adding about 1500 lines to my canvas my Windows 8 App always crashes. What could be the best practice to achieve this?
One solution could be rendering everything on an image (how do I do this?). But then I loose comfort of easy access and editing of every element.
Also my scale and translate is very slow. But since I also need a big overview, it makes no sense to put only the objects of the visible area in the canvas, since on minimum zoom it's still everything and zoomed it's still very laggy cause of add and remove operations.
There are a couple of different things you should employ to have a smooth UX:
Use a Quadtree, whenever you add a shape to your canvas you also put it on your Quadtree. This will be helpful when you will zoom on a portion of the image: you will know what objects are in this portion of the image; you will render them again (against using a cached/pixellated version).
To overcome the potentially lengthy drawing process you could do the following:
display the portion of the cached image overview at the right scale
use a progress indicator to let know the user that the program is working render this portion
when the faint rendering is done, blit it on the screen
A concrete example: Google Maps does that.

Custom UI control for Android and IOS using C#

I've just started looking at how I can generate and port applications to Android and IOS, I've started to look at Xamarin. First, I'm looking to generate custom UI control of a 10x10 Matrix (checkerboard - each square is a different colour) with each square being able to be selected and a specific image being displayed.
After looking at the documents and looking at MVVM examples, I'm not entirely sure what the best method of doing this : How should I structure the code (should I use just SVG drawing) or is there a better method of doing this in Android and IOS ?
To be honest I would start with Xamarin Forms and create a grid control with 10x10 image buttons. This way you get the event handling built-in. This would work for iOS, Android & Windows Phone out of the box. From there you could evolve it to more native specific code if necessary.
If you want to control the look pixel perfect then creating native custom rendered views would be the option but this is much more work of course so I would not start there. On Android you would subclass from Android.Widget.View and on iOS you would do it from MonoTouch.UIKit.UIView. For both you would override the Draw method.

Categories