BrowserFileExtensions.RequestImageFileAsync メソッド

定義

現在のイメージ ファイルを、指定したファイルの種類と最大ファイル サイズの新しいものに変換しようとします。

注意: ファイルが変換される保証はなく、変換前または変換後に有効なイメージファイルになることさえあります。 変換は.NET コードに転送される前にブラウザー内で要求されるため、結果のデータは信頼されていないものとして扱う必要があります。

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)

パラメーター

browserFile
IBrowserFile

IBrowserFile新しいイメージ ファイルに変換する 。

format
String

新しいイメージ形式。

maxWithmaxWidth
Int32

イメージの最大幅。

maxHeight
Int32

画像の最大高さ

戻り値

ValueTask操作の完了を表す 。

注釈

イメージは、元の縦横比を維持しながら、指定した寸法に合わせてスケーリングされます。

適用対象