JakeBass Posted June 2, 2015 at 10:05 AM Report #584081 Posted June 2, 2015 at 10:05 AM preciso de cortar imagens mas não sei como posicionar a imagem dentro das coordenadas desejadas. há 4 variaveis que são os pixeis a cortar de cada lado. o que tenho é o seguinte: Rectangle cropRect = new Rectangle(); cropRect.Width = src.Width - left_crop - right_crop; cropRect.Height = src.Height - top_crop - bottom_crop; Bitmap target = new Bitmap(src, cropRect.Width, cropRect.Height);
He B TeMy Posted June 2, 2015 at 12:37 PM Report #584089 Posted June 2, 2015 at 12:37 PM O teu objectivo é cortar ou redimensionar?
JakeBass Posted June 2, 2015 at 12:41 PM Author Report #584090 Posted June 2, 2015 at 12:41 PM (edited) é cortar, ou "crop" claro que ao fazer isto a imagem poderá ficar com outras dimensões, mas a resolução(dpi) deve permanecer a mesma. Edited June 2, 2015 at 12:50 PM by sketxz
He B TeMy Posted June 2, 2015 at 12:45 PM Report #584091 Posted June 2, 2015 at 12:45 PM Dà uma vista de olhos aqui, http://stackoverflow.com/questions/734930/how-to-crop-an-image-using-c não te consigo dar um exemplo meu visto que não me recordo e não tenho tempo para testar aqui...
JakeBass Posted June 2, 2015 at 01:00 PM Author Report #584092 Posted June 2, 2015 at 01:00 PM sim, talvez seja isso. Uma das dúvidas que tenho é como passar um elemento Graphics para Bitmap.
Solution JakeBass Posted June 2, 2015 at 01:25 PM Author Solution Report #584094 Posted June 2, 2015 at 01:25 PM Resolvido, precisava do drawImage(). Se criar um Graphics a partir de um Bitmap, qualquer operação aplica-se ao bitmap. Obrigado
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now