|
1 | 1 | --- |
2 | 2 | layout: post |
3 | 3 | title: Resizing with Blazor Image Editor Component | Syncfusion |
4 | | -description: Checkout the Resizing available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. |
| 4 | +description: Explore the resizing support in the Blazor Image Editor component for Blazor Server and WebAssembly applications. |
5 | 5 | platform: Blazor |
6 | 6 | control: Image Editor |
7 | 7 | documentation: ug |
8 | 8 | --- |
9 | 9 |
|
10 | 10 | # Resize in the Blazor Image Editor component |
11 | 11 |
|
12 | | -The resize feature in an Image Editor is a valuable tool that empowers users to modify the size or dimensions of an image to meet their specific requirements. Whether it's for printing, web display, or any other purpose, this feature allows users to tailor images to their desired specifications. |
| 12 | +The resize feature adjusts the size or dimensions of an image to match specific requirements for printing, web display, or other use cases. |
13 | 13 |
|
14 | 14 | ## Apply resize to the image |
15 | 15 |
|
16 | | -The Image Editor control includes a [`ImageResizeAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ImageResizeAsync_System_Int32_System_Int32_System_Boolean_) method, which allows you to adjust the size of an image. This method takes three parameters that define how the resizing should be carried out: |
| 16 | +The Image Editor control provides the [`ImageResizeAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ImageResizeAsync_System_Int32_System_Int32_System_Boolean_) method to change image size. This method accepts three parameters that define the resizing behavior: |
17 | 17 |
|
18 | | -* width: Specifies the resizing width of the image. |
| 18 | +- width: Sets the target width of the image. |
19 | 19 |
|
20 | | -* height: Specifies the resizing height of the image. |
| 20 | +- height: Sets the target height of the image. |
21 | 21 |
|
22 | | -* isAspectRatio: Specifies a boolean value indicating whether the image should maintain its original aspect ratio during resizing. |
23 | | - * When set to `true`, the image maintains its original aspect ratio. The width is applied as specified, and the height is automatically adjusted to maintain the aspect ratio. |
24 | | - * When set to `false`, the image is resized according to the specified width and height, without maintaining the aspect ratio. |
25 | | - * The default value is `false`. |
| 22 | +- isAspectRatio: Indicates whether to preserve the original aspect ratio. |
| 23 | + - When `true`, the image maintains its original aspect ratio. The specified width is applied, and the height adjusts automatically. |
| 24 | + - When `false`, the image resizes to the specified width and height without preserving the aspect ratio. |
| 25 | + - The default value is `false`. |
26 | 26 |
|
27 | | -Here is an example of resizing the image using the `ImageResizeAsync` method. |
| 27 | +Here is an example of resizing the image using the `ImageResizeAsync` method. |
28 | 28 |
|
29 | 29 | ```cshtml |
30 | 30 | @using Syncfusion.Blazor.ImageEditor |
@@ -60,22 +60,22 @@ Here is an example of resizing the image using the `ImageResizeAsync` method. |
60 | 60 | } |
61 | 61 | ``` |
62 | 62 |
|
63 | | - |
| 63 | + |
64 | 64 |
|
65 | 65 | ## Resizing event |
66 | 66 |
|
67 | | -The [`ImageResizing`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageResizing) event is triggered when resizing the image. This event provides information encapsulated within an object, which includes details about the previous and current height and width of an image. |
| 67 | +The [`ImageResizing`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageResizing) event triggers while an image is being resized and provides details about the previous and current dimensions. |
68 | 68 |
|
69 | | -The parameter available in ResizeEventArgs is, |
| 69 | +Parameters available in [ImageResizeEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html): |
70 | 70 |
|
71 | | -* [`ImageResizeEventArgs.PreviousWidth`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousWidth) - The width of the image before resizing is performed. |
| 71 | +- [`ImageResizeEventArgs.PreviousWidth`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousWidth) – The width of the image before resizing. |
72 | 72 |
|
73 | | -* [`ImageResizeEventArgs.PreviousHeight`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousHeight) - The height of the image before resizing is performed. |
| 73 | +- [`ImageResizeEventArgs.PreviousHeight`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousHeight) – The height of the image before resizing. |
74 | 74 |
|
75 | | -* [`ImageResizeEventArgs.Width`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Width) - The width of the image after resizing is performed. |
| 75 | +- [`ImageResizeEventArgs.Width`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Width) – The width of the image after resizing. |
76 | 76 |
|
77 | | -* [`ImageResizeEventArgs.Height`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Height) - The width of the image after resizing is performed. |
| 77 | +- [`ImageResizeEventArgs.Height`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Height) – The height of the image after resizing. |
78 | 78 |
|
79 | | -* [`ImageResizeEventArgs.IsAspectRatio`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_IsAspectRatio) - The type of resizing performed such as aspect ratio or non-aspect ratio. |
| 79 | +- [`ImageResizeEventArgs.IsAspectRatio`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_IsAspectRatio) – Indicates whether the resizing preserved the aspect ratio. |
80 | 80 |
|
81 | | -* [`ImageResizeEventArgs.Cancel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Cancel) - Specifies a boolean value to cancel the resizing action. |
| 81 | +- [`ImageResizeEventArgs.Cancel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Cancel) – A boolean value that cancels the resizing action when set to true. |
0 commit comments