Ver Mensaje Individual
  #5  
Antiguo 04-06-2010
Avatar de radenf
radenf radenf is offline
Miembro
 
Registrado: oct 2007
Ubicación: Viña del Mar,Chile
Posts: 608
Reputación: 17
radenf Va por buen camino
Estimado yapt :

Respecto a tu primera pregunta no tengo idea porque no uso el componente TShape.
La segunda pregunta te la respondo adjuntando el código requerido:

Código Delphi [-]
procedure TCapFoto.BtnRecortarClick(Sender: TObject);
Var New, Old : TRect;
Bitmap:TBitmap;
Begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:\foto.bmp');
New.Left:=SizeRect1.ClientRect.Left;
New.Top:=SizeRect1.ClientRect.Top;
New.Right:=SizeRect1.ClientRect.Right;
New.Bottom:=SizeRect1.ClientRect.Bottom;
Old := New;
Image2.Create(Self);
Image2.Left:=SizeRect1.Left;
Image2.Top:=SizeRect1.Top;
Image2.Height:=SizeRect1.Height;
Image2.Width:=SizeRect1.Width;
Image2.Canvas.CopyRect(Old,SizeRect1.Canvas,New);
Image2.Visible:= False;
Image2.Picture.SaveToFile('c:\Foto.bmp');
Bitmap.LoadFromFile('c:\foto.bmp');
Image3.Picture.Bitmap.Assign (Bitmap);
Image3.Visible:= True;
Image3.BringToFront;
end;

Código Delphi [-]
procedure TCapFoto.BtnGuardarClick(Sender: TObject);
var Bitmap: TBitmap; jpeg: TJPEGImage;
begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:\foto.bmp');
jpeg := TJPEGImage.Create;
jpeg.Assign(Bitmap);
jpeg.CompressionQuality := 100;
jpeg.SaveToFile('c:\foto.jpg');
jpeg.Destroy;
Bitmap.Destroy;
end;

El componente SizeComps hace todo el trabajo. Sólo debes hacer previamente la captura a un Timage, donde se genera el archivo 'c:\foto.bmp'. Yo lo utilizo con Delphi 2007 y funciona perfecto. No sé si funcionará en Delphi 2010.
Espero que te sirva.
Salu2
Responder Con Cita