Image Editing

This documentation outlines the guidelines for utilizing the Image Module SDK, which offers powerful image editing tools. The SDK provides straightforward methods to incorporate advanced image editing functionalities into your

Prerequisites

  • Ensure you have integrated the TruVideo Core SDK into your project and completed with the authentication process

  • Camera module will provide MediaItem or simply provide filepath to upload (optional)

Edit an Image

To edit an image, follow these steps:

Step 1 : Import Classes and init Callback Wrapper

#if IOS
using Foundation;
using UIKit;
using TruvideoImageiOS;
#endif

#if ANDROID
using Application = Android.App.Application;
using TruVideoImageAndroidBinding;
using TruVideoImageLib = TruVideoImageAndroid.DotnetTruvideoImage;
#endif


#if ANDROID
 private Task<T> ExecuteImageCallbackAsync<T>(Action<ImageCallback> action) {
        var tcs = new TaskCompletionSource<T>();

        action.Invoke(new ImageCallback(
            success => MainThread.BeginInvokeOnMainThread(() =>
                tcs.TrySetResult((T)Convert.ChangeType(success, typeof(T)))),
            failure => MainThread.BeginInvokeOnMainThread(() => tcs.TrySetException(new Exception(failure)))
        ));

        return tcs.Task;
    }
#endif

Step 2 : Get Result File path where to place the save image

This function returns the result path using the provided file name as input.

Step 3 : Call Image Edit

After obtaining the result path, invoke the launchImageEdit function to edit

Finalize :

After completing this steps the function should look like

Learn More

Explore advanced capabilities of the Image Module in the Image Module Reference.

Last updated

Was this helpful?