mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-02 12:07:44 +08:00
c9656ca227
* feat(module: image): add image * add image preview * add locale
45 lines
852 B
C#
45 lines
852 B
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class ImagePreview
|
|
{
|
|
[Parameter]
|
|
public string ImageUrl { get; set; }
|
|
|
|
[Inject]
|
|
private ImageService ImageService { get; set; }
|
|
|
|
private int _zoomOutTimes = 1;
|
|
private int _rotateTimes;
|
|
|
|
private void HandleClose()
|
|
{
|
|
ImageService.CloseImage(ImageUrl);
|
|
}
|
|
|
|
private void HandleZoomIn()
|
|
{
|
|
_zoomOutTimes++;
|
|
}
|
|
|
|
private void HandleZoomOut()
|
|
{
|
|
if (_zoomOutTimes > 1)
|
|
{
|
|
_zoomOutTimes--;
|
|
}
|
|
}
|
|
|
|
private void HandleRotateRight()
|
|
{
|
|
_rotateTimes++;
|
|
}
|
|
|
|
private void HandleRotateLeft()
|
|
{
|
|
_rotateTimes--;
|
|
}
|
|
}
|
|
}
|