Class SfImageEditor
Inheritance
Implements
Namespace: Syncfusion.SfImageEditor.Android
Assembly: Syncfusion.SfImageEditor.Android.dll
Syntax
public class SfImageEditor : FrameLayout, IDisposable
Constructors
SfImageEditor(Context)
Initializes a new instance of theSfImageEditor class.
Declaration
public SfImageEditor(Context context)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context |
SfImageEditor(Context, IAttributeSet)
Initializes a new instance of theSfImageEditor class.
Declaration
public SfImageEditor(Context context, IAttributeSet attributes)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | Context |
Android.Util.IAttributeSet | attributes |
SfImageEditor(Context, IAttributeSet, Int32)
Declaration
public SfImageEditor(Context context, IAttributeSet attribute, int defaultStyleAttribute)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | |
Android.Util.IAttributeSet | attribute | |
System.Int32 | defaultStyleAttribute |
SfImageEditor(Context, IAttributeSet, Int32, Int32)
Declaration
public SfImageEditor(Context context, IAttributeSet attribute, int defaultStyleAttribute, int defaultStyleResource)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | |
Android.Util.IAttributeSet | attribute | |
System.Int32 | defaultStyleAttribute | |
System.Int32 | defaultStyleResource |
Properties
ActualImageRenderedBounds
To get the actual image rendered bounds
Declaration
public Rectangle ActualImageRenderedBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
Bitmap
Gets or sets the bitmap for the image
Declaration
public Bitmap Bitmap { get; set; }
Property Value
Type |
---|
Android.Graphics.Bitmap |
ColorPalette
Gets or sets the colors for the shapes in the toolbar
Declaration
public ObservableCollection<Color> ColorPalette { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<Android.Graphics.Color> |
DefaultSelectedColorIndex
Gets or sets the DefaultSelectedColor Index value
Declaration
public int DefaultSelectedColorIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
EffectValue
Gets or sets the value to apply the image effects.
Declaration
public float EffectValue { get; set; }
Property Value
Type |
---|
System.Single |
EnableAutoSelectText
Gets or sets selection of edit text enable or not.
Declaration
public bool EnableAutoSelectText { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableZooming
Gets or sets the zooming of the image
Declaration
public bool EnableZooming { get; set; }
Property Value
Type |
---|
System.Boolean |
ImageEffect
Gets or sets the effect of the image.
Declaration
public ImageEffect ImageEffect { get; set; }
Property Value
Type |
---|
ImageEffect |
IsImageEdited
Gets a value indicating whether the original image is edited or not
Declaration
public bool IsImageEdited { get; }
Property Value
Type |
---|
System.Boolean |
IsImageZoomed
Gets a boolean value that indicate whether the image gets zoomed or not. It is a read-only property.
Declaration
public bool IsImageZoomed { get; }
Property Value
Type |
---|
System.Boolean |
IsSelected
Gets a value indicating whether any shape/text is selected.
Declaration
public bool IsSelected { get; }
Property Value
Type |
---|
System.Boolean |
MaximumZoomLevel
Gets or sets the maximum zoom level value.This property used to restrict the image zooming, when changing zoom level using pinch or ZoomLevel property.
Declaration
public float MaximumZoomLevel { get; set; }
Property Value
Type |
---|
System.Single |
OriginalImageSize
To get the original image size
Declaration
public Size OriginalImageSize { get; }
Property Value
Type |
---|
System.Drawing.Size |
PanningMode
Gets or sets the PanningMode to zoom the image in single or two finger.
Declaration
public PanningMode PanningMode { get; set; }
Property Value
Type |
---|
PanningMode |
RotatableElements
Gets or sets rotatable elements in the editor
Declaration
public ImageEditorElements RotatableElements { get; set; }
Property Value
Type |
---|
ImageEditorElements |
ToolbarSettings
Gets or sets toolbar settings of the image editor
Declaration
public ToolbarSettings ToolbarSettings { get; set; }
Property Value
Type |
---|
ToolbarSettings |
ZoomLevel
Gets or sets the zoom level value. This property is used to change the image zoom level programmatically.
Declaration
public double ZoomLevel { get; set; }
Property Value
Type |
---|
System.Double |
Methods
add_BeginReset(BeginResetEventHandler)
Declaration
public void add_BeginReset(BeginResetEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
BeginResetEventHandler | value |
add_EndReset(EndResetEventHandler)
Declaration
public void add_EndReset(EndResetEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
EndResetEventHandler | value |
add_ImageLoaded(ImageLoadedEventHandler)
Declaration
public void add_ImageLoaded(ImageLoadedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageLoadedEventHandler | value |
add_ImageSaved(ImageSavedEventHandler)
Declaration
public void add_ImageSaved(ImageSavedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageSavedEventHandler | value |
add_ImageSaving(ImageSavingEventHandler)
Declaration
public void add_ImageSaving(ImageSavingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageSavingEventHandler | value |
add_ItemSelected(ItemSelectedEventHandler)
Declaration
public void add_ItemSelected(ItemSelectedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ItemSelectedEventHandler | value |
add_ItemUnselected(ItemUnselectedEventHandler)
Declaration
public void add_ItemUnselected(ItemUnselectedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ItemUnselectedEventHandler | value |
AddCustomView(View, CustomViewSettings)
To add any view on the image.
Declaration
public void AddCustomView(View view, CustomViewSettings customViewSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Android.Views.View | view | The parameter contains the custom view |
CustomViewSettings | customViewSettings | The parameter contains the CustomViewSettings |
AddShape(ShapeType, PenSettings)
To draw shape on image with its type (Rectangle or Circle)
Declaration
public void AddShape(ShapeType shapeType, PenSettings penSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ShapeType | shapeType | A ShapeType |
PenSettings | penSettings | PenSettings |
AddText(String, TextSettings)
To draw a text on image
Declaration
public void AddText(string text = "", TextSettings textSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text |
TextSettings | textSettings | The TextSettings |
ApplyImageEffect(ImageEffect, Single)
ApplyImageFilters method is used to apply the image effects without using Toolbar
Declaration
public void ApplyImageEffect(ImageEffect imageEffects, float amount)
Parameters
Type | Name | Description |
---|---|---|
ImageEffect | imageEffects | |
System.Single | amount | float |
BringForward()
Bring to forward the selected shape
Declaration
public void BringForward()
BringToFront()
Bring to front the selected shape
Declaration
public void BringToFront()
ClearAnnotations()
Clear the shapes/text added on the image.
Declaration
public void ClearAnnotations()
Crop(Rectangle, Boolean)
Crops the image based on the specified bounds.
Declaration
public void Crop(Rectangle rectangle = null, bool isEllipse = false)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rectangle | Bounds to crop the image.(Optional). |
System.Boolean | isEllipse | True to crop in elliptical shape, false otherwise.(Optional). |
Delete()
Remove the selected Shape/Text from image
Declaration
public void Delete()
Dispose(Boolean)
The method to dispose the objects
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | The parameter to dispose object |
Flip(FlipDirection)
To flip the image with direction (Horizontal or vertical)
Declaration
public void Flip(FlipDirection flipDirection)
Parameters
Type | Name | Description |
---|---|---|
FlipDirection | flipDirection | The FlipDirection |
GetStream()
Gets the Stream of the Image
Declaration
public Task<Stream> GetStream()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.IO.Stream> | A Stream |
LoadEdits(Stream)
Set serialized object as json stream
Declaration
public void LoadEdits(Stream jsonStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | jsonStream |
OnSizeChanged(Int32, Int32, Int32, Int32)
The method to update the child when size changed.
Declaration
protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | w | |
System.Int32 | h | |
System.Int32 | oldw | |
System.Int32 | oldh |
Redo()
Performs redo operation
Declaration
public void Redo()
remove_BeginReset(BeginResetEventHandler)
Declaration
public void remove_BeginReset(BeginResetEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
BeginResetEventHandler | value |
remove_EndReset(EndResetEventHandler)
Declaration
public void remove_EndReset(EndResetEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
EndResetEventHandler | value |
remove_ImageLoaded(ImageLoadedEventHandler)
Declaration
public void remove_ImageLoaded(ImageLoadedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageLoadedEventHandler | value |
remove_ImageSaved(ImageSavedEventHandler)
Declaration
public void remove_ImageSaved(ImageSavedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageSavedEventHandler | value |
remove_ImageSaving(ImageSavingEventHandler)
Declaration
public void remove_ImageSaving(ImageSavingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ImageSavingEventHandler | value |
remove_ItemSelected(ItemSelectedEventHandler)
Declaration
public void remove_ItemSelected(ItemSelectedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ItemSelectedEventHandler | value |
remove_ItemUnselected(ItemUnselectedEventHandler)
Declaration
public void remove_ItemUnselected(ItemUnselectedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ItemUnselectedEventHandler | value |
Reset()
Resets image to its orginal state
Declaration
public void Reset()
Rotate()
Rotates the image based on angle (degrees)
Declaration
public void Rotate()
Save(String, Size)
Saves the Image to a location
Declaration
public void Save(string format = null, Size size = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | |
System.Drawing.Size | size |
SaveEdits()
Get Serialized Object in stream
Declaration
public Stream SaveEdits()
Returns
Type |
---|
System.IO.Stream |
SelectShape(Int32)
To select the annotation added on image programatically using its unique ID.
Declaration
public void SelectShape(int ID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ID | The unique ID. |
SendBackward()
Send to Backward the selected shape
Declaration
public void SendBackward()
SendToBack()
Send to back the selected shape
Declaration
public void SendToBack()
SetToolbarItemVisibility(String, Boolean)
To set the toolbar item visibility based on the icon name
Declaration
public void SetToolbarItemVisibility(string name, bool isVisible)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The icon name to be hidden |
System.Boolean | isVisible | Set the visibility |
Tilt(Double)
To rotate the image from -45 to 45 degree in preview state. To crop the preview rotation, call Crop() method of SfImageEditor.
Declaration
public void Tilt(double angle)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angle | double value to get the tilt angle |
ToggleCropping()
Declaration
public void ToggleCropping()
ToggleCropping(Boolean, Int32)
Enables the cropping preview sub toolbar items. Specify selectedIndex value to customize default selection of cropping preview toolbar item.
Declaration
public void ToggleCropping(bool showToolbarItems, int selectedIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | showToolbarItems | Enable or disable cropping preview toolbar items. |
System.Int32 | selectedIndex | Change the default cropping selection preview toolbar item. |
ToggleCropping(RectangleF)
To enable the cropping option on image with rect
Declaration
public void ToggleCropping(RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect | The parmeter contains cropping rectangle |
ToggleCropping(RectangleF, Boolean)
Enables the cropping preview on the image with the specified rectangle bounds. Specify isEllipse as true to crop in elliptical shape.the cropping preview on the image with the specified rectangle bounds. Specify isEllipse as true to crop in elliptical shape.
Declaration
public void ToggleCropping(RectangleF rectangle, bool isEllipse)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | Bounds of the cropping preview on the image. |
System.Boolean | isEllipse | True to crop in elliptical shape, false otherwise. |
ToggleCropping(Single, Single, Boolean)
Enables a cropping preview on the image with the specified ratio.
Declaration
public void ToggleCropping(float ratioX, float ratioY, bool isEllipse = false)
Parameters
Type | Name | Description |
---|---|---|
System.Single | ratioX | x ratio. |
System.Single | ratioY | y ratio. |
System.Boolean | isEllipse | Shape of the cropping, either in elliptical or rectangular format. |
Undo()
Performs undo operation
Declaration
public void Undo()
Events
BeginReset
Declaration
public event BeginResetEventHandler BeginReset
Event Type
Type |
---|
BeginResetEventHandler |
EndReset
Declaration
public event EndResetEventHandler EndReset
Event Type
Type |
---|
EndResetEventHandler |
ImageEdited
The event raised when the Image is Edited
Declaration
public event EventHandler<ImageEditedEventArgs> ImageEdited
Event Type
Type |
---|
System.EventHandler<ImageEditedEventArgs> |
ImageLoaded
Declaration
public event ImageLoadedEventHandler ImageLoaded
Event Type
Type |
---|
ImageLoadedEventHandler |
ImageSaved
Declaration
public event ImageSavedEventHandler ImageSaved
Event Type
Type |
---|
ImageSavedEventHandler |
ImageSaving
Declaration
public event ImageSavingEventHandler ImageSaving
Event Type
Type |
---|
ImageSavingEventHandler |
ItemSelected
Declaration
public event ItemSelectedEventHandler ItemSelected
Event Type
Type |
---|
ItemSelectedEventHandler |
ItemUnselected
ItemUnselected event
Declaration
public event ItemUnselectedEventHandler ItemUnselected
Event Type
Type |
---|
ItemUnselectedEventHandler |