Share via


BrowserFileExtensions.RequestImageFileAsync Método

Definição

Tenta converter o arquivo de imagem atual em um novo tipo de arquivo especificado e dimensões máximas de arquivo.

Cuidado: não há nenhuma garantia de que o arquivo será convertido ou até mesmo será um arquivo de imagem válido, antes ou depois da conversão. A conversão é solicitada no navegador antes de ser transferida para o código .NET, portanto, os dados resultantes devem ser tratados como não confiáveis.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<Microsoft::AspNetCore::Components::Forms::IBrowserFile ^> RequestImageFileAsync(Microsoft::AspNetCore::Components::Forms::IBrowserFile ^ browserFile, System::String ^ format, int maxWith, int maxHeight);
public static System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Components.Forms.IBrowserFile> RequestImageFileAsync (this Microsoft.AspNetCore.Components.Forms.IBrowserFile browserFile, string format, int maxWith, int maxHeight);
public static System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Components.Forms.IBrowserFile> RequestImageFileAsync (this Microsoft.AspNetCore.Components.Forms.IBrowserFile browserFile, string format, int maxWidth, int maxHeight);
static member RequestImageFileAsync : Microsoft.AspNetCore.Components.Forms.IBrowserFile * string * int * int -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Components.Forms.IBrowserFile>
static member RequestImageFileAsync : Microsoft.AspNetCore.Components.Forms.IBrowserFile * string * int * int -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Components.Forms.IBrowserFile>
<Extension()>
Public Function RequestImageFileAsync (browserFile As IBrowserFile, format As String, maxWith As Integer, maxHeight As Integer) As ValueTask(Of IBrowserFile)
<Extension()>
Public Function RequestImageFileAsync (browserFile As IBrowserFile, format As String, maxWidth As Integer, maxHeight As Integer) As ValueTask(Of IBrowserFile)

Parâmetros

browserFile
IBrowserFile

O IBrowserFile a ser convertido em um novo arquivo de imagem.

format
String

O novo formato de imagem.

maxWithmaxWidth
Int32

A largura máxima da imagem.

maxHeight
Int32

A altura máxima da imagem

Retornos

Um ValueTask que representa a conclusão da operação.

Comentários

A imagem será dimensionada para se ajustar às dimensões especificadas, preservando a taxa de proporção original.

Aplica-se a