Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 23-09-2005
fmtidona fmtidona is offline
Miembro
 
Registrado: sep 2005
Posts: 17
Poder: 0
fmtidona Va por buen camino
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
Responder Con Cita
  #2  
Antiguo 24-09-2005
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Poder: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

¿Viste ya el ejemplo que se proporciona en la ayuda de Delphi para el método "CopyRect" de "TCanvas"?

Cita:
Empezado por Ayuda de Delphi
The following code illustrates the differences between CopyRect and BrushCopy. The bitmap graphic ‘TARTAN.BMP’ is loaded into Bitmap and displayed on the Canvas of Form1. BrushCopy replaces the color black in the graphic with the brush of the canvas, while CopyRect leaves the colors intact.

Código Delphi [-]
 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.Free;
  end;
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita
  #3  
Antiguo 26-09-2005
fmtidona fmtidona is offline
Miembro
 
Registrado: sep 2005
Posts: 17
Poder: 0
fmtidona Va por buen camino
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;
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 00:26:53.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi