Skip to content

Does the Cropper component support dynamic modification of the Source property? #5179

Closed Answered by DomenicoFormoso
ZeroFantom asked this question in Q&A
Discussion options

You must be logged in to vote

I updated to version 1.43 and changed the code and it works fine.


<FileEdit Changed="@CaricaFile" Filter=".jpeg, .jpg, .png">Carica</FileEdit>

<Cropper 
@ref="@cropper" 
Source="@FileCropper" 
SelectionOptions="@(new CropperSelectionOptions { AspectRatio = CropperAspectRatio.IsFree})" SelectionChanged="@OnSelectionChanged" 
Style="@styleCropper" />

private string styleCropper = "height:1000px;width:1000px";


private async Task CaricaFile(FileChangedEventArgs e)
{
    try
    {
        byte[] bytes;
        using (MemoryStream result = new MemoryStream())
        {
            await e.Files.First().OpenReadStream(long.MaxValue).CopyToAsync(result);
            bytes = result.ToArray();…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@ZeroFantom
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@stsrki
Comment options

@ZeroFantom
Comment options

Answer selected by stsrki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants