Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

redimensionar imagem

Recommended Posts

redimensionar sua imagem para qualquer tamanho de miniatura que deseja, mantendo relação da imagem.

Este código requer que você envie a imagem original com largura e altura.

 

Sub NovoTam(ByVal w, ByVal h, ByRef NewWidth, ByRef NewHeight, ByVal BoxSize)
		'If Width > Height Then Width = BoxSize e calcular Altura
		'Else Height > Width Then Height = BoxSize e calcular Largura
		if w > h Then
			NewWidth = BoxSize
			NewHeight = CLng((BoxSize * h) / w)
		Else
			NewHeight = BoxSize
			NewWidth = CLng((BoxSize * w) / h)
		End if
		
		'Se NewWidth> imagem largura e NewHeight> Altura da imagem 
	 'NewWidth = imagem largura e altura NewHeight = imagem
		
		if NewWidth > w AND NewHeight > h Then
			NewWidth = w
			NewHeight = h
		End if
		
		'If Width and Height < BoxSize Then Image = tamanho Orginal 
		
		if w < BoxSize AND h < BoxSize Then
			NewWidth = w
			NewHeight = h
		End if
	End Sub

Compartilhar este post


Link para o post
Compartilhar em outros sites

Fala galera.

 

Vi um efeito na pagina inicial do site da nestle. www.nestle.com.br

E quero fazer isso pra um clientes meu,

 

Alguem pode me ajudar?

 

Valeu!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.