Friends,
Following the examples posted, I made the adjustments:
public ActionResult ThumbNail(int largura, int altura, string caminhofoto)
{
if (caminhofoto != "caminho" )
{
WebImage webImagem = new WebImage(@caminhofoto).Resize(largura, altura, false, false);
return File(webImagem.GetBytes(), @caminhofoto);
}
return View();
}
This ActionResult up must get Jquery:
<script >
function BuscarCaminho()
{
//Pega o elemento 'select'
var select = document.getElementById("selecao");
//Altera o valor do atributo 'src' da imagem para carregar a imagem selecionada
if (select != "") {
document.getElementById('caminho').src = select.value;
// alert(select.value);
}
}
This is Jquery Changed, I'm passing the photo path:
<div >
<img id="foto" src="@Url.Action("Thumbnail", "ConsultaCliente", new {caminhofoto = "caminho", largura = 100, altura = 100 })" alt="thumbnail" />
</div>
<label>Foto:</label>
<div id="selecao" onchange="BuscarCaminho()" >
@Html.DropDownList("idFoto", String.Empty)
</div>
At this point, for each selected photo I want to send the image to be viewed on the screen. I thank you