FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Recortar Imagen
De forma casera, hago........
bitmap.Width := BitMap.Width - constanteA; bitmap.Height := BitMap.Height - constanteB; con esto logro recortar la base y el costado derecho, solo me falta recortar el lateral izquierdo y la parte superior. estuve viendo la instruccion CopyRect(), que aparentemente me solucionaria el problema, pero no la pude hacer andar y no hay mucha ayuda. gracias |
#2
|
||||
|
||||
Hola,
¿Viste ya el ejemplo que se proporciona en la ayuda de Delphi para el método "CopyRect" de "TCanvas"? Cita:
|
#3
|
|||
|
|||
Muchas gracias, logre recortar la foto, pero al grabarla me graba la foto original y no la parte que recorte
var Bitmap: TBitmap; MyRect, MyOther: TRect; begin MyRect := Rect(10,10,100,100); MyOther := Rect(10,111,100, 201); Bitmap := TBitmap.Create; Bitmap.LoadFromFile('c:\windows\tartan.bmp'); Form1.Canvas.BrushCopy(MyRect, Bitmap, MyRect, clBlack); Form1.Canvas.CopyRect(MyOther,Bitmap.Canvas,MyRect); bitmap.SaveToFile('c:\windows\tartan.bmp'); Bitmap.Free; end; |
|
|
|