Share via


How to combine separate images into single one?

Question

Saturday, April 22, 2017 7:56 PM

Hi, I would like to display a bunch of images to form similar pattern as in this image previously I was thinking about skiasharp or System.Drawing but couldn't warp my head around it. So decided to workaround it like this: merge images into one -> display merged image. Unfortunately it does not work so easy on mono as on .net (https://pastebin.com/mx0fFu6s) any suggestions? e.g. Graphics and System.Drawing.Bitmap is unavailable.

All replies (5)

Monday, April 24, 2017 6:53 AM ✅Answered

Hi @aljr,

I had a look at your code and whipped up a SkiaSharp sample: https://github.com/mattleibow/SkiaSharpImageMerger

Let me know if this works for you. It is the same amount of code, but now works everywhere, including .NET Core, Xamarin, Windows, Mac, Linux 😉


Sunday, April 23, 2017 8:26 AM

Go for SkiaSharp.

We did it once (in 2012) on one commercial project (thus no details) where opensourced c/c++ library was used and then with accessed with PInvoke. It was port from Windows Mobile/CE to MonoTouch (Xamarin.iOS), never made it to Mono for Android.


Monday, April 24, 2017 1:58 PM

@mattleibow said: Hi @aljr,

I had a look at your code and whipped up a SkiaSharp sample: https://github.com/mattleibow/SkiaSharpImageMerger

Let me know if this works for you. It is the same amount of code, but now works everywhere, including .NET Core, Xamarin, Windows, Mac, Linux 😉

Thank you very much :) what was your source of information? only documentation?


Monday, April 24, 2017 8:07 PM

My source? It was myself :) I am the guy who is writing the library/API ;)

But, you could have a look at some docs to get to know the API better:

Although the guides say for Xamarin.Forms, it pretty much can be used anywhere - especially since the API is exactly the same as the "normal" platforms (in fact the portable API is generated FROM the native API).


Wednesday, August 19, 2020 1:32 PM

I have prepared a small sample of creating a photo collage with Skiasharp. Please take a look. https://sreerajpr.com/blogs/xamarin-forms-photo-collage-skiasharp/

This is based on the sample prepared by @mattleibow