Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Sending Stream vs disk data path - performance

$
0
0

I am coding a dependency service that can process my pictures. Instead of coding exactly what I need I am trying to make a class I can use in the future.
It have functions like crop, resize, set quality and some functions for converting ImageSources. I get a path to an image from Xamarin.Mobile. But I am not sure how it would be smartest to handle this file.

Because I want to use the functions separately in the future I am calling them one after another from Forms. As it is now, I am using streams. sending streams back and forth between Forms and iOS, and making a lot of data copying.

Would it be better to send the file path to iOS, open the picture, doing my image processing, then save the picture and return a path instead of sending streams?

Also there is a lot of converting now because I need to send a StreamImageSource, then converting to a stream -> NSData -> UIImage -> Crop and then return a stream as StreamImageSource back to Forms.

It's all about performance for me.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>