Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 10-09-2014
Avatar de ElKurgan
[ElKurgan] ElKurgan is offline
Miembro Premium
 
Registrado: nov 2005
Posts: 1.243
Poder: 22
ElKurgan Va camino a la fama
En este mismo foro se habló del tema

Saludos
Responder Con Cita
  #2  
Antiguo 10-09-2014
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.474
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Aquí tienes otro hilo con ejemplo incluído.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.

Última edición por Neftali [Germán.Estévez] fecha: 10-09-2014 a las 18:15:19. Razón: Añadir el link
Responder Con Cita
  #3  
Antiguo 10-09-2014
Avatar de radenf
radenf radenf is offline
Miembro
 
Registrado: oct 2007
Ubicación: Viña del Mar,Chile
Posts: 608
Poder: 19
radenf Va por buen camino
Estimado Jose Roman:

Los componentes SizeComps, que son gratuitos, te permiten modificar el área seleccionada de una imagen.
Los puedes descargar desde este link
Ojalá te sirvan

Salu2
Responder Con Cita
  #4  
Antiguo 10-09-2014
Jose Roman Jose Roman is offline
Miembro
 
Registrado: jul 2006
Ubicación: Colombia
Posts: 364
Poder: 21
Jose Roman Va por buen camino
Gracias a todos, empezare a ensayar, Neftali no veo el link que mencionas....??
Responder Con Cita
  #5  
Antiguo 10-09-2014
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.474
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por Jose Roman Ver Mensaje
Gracias a todos, empezare a ensayar, Neftali no veo el link que mencionas....??
Porque no lo he puesto...

Este es al que me refería, aunque si buscas hay más.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #6  
Antiguo 10-09-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola Jose Roman.

Te hice un ejemplo que usa sólo componentes estándar de Delphi, dos Timage, un TShape y dos TButton :
Código Delphi [-]
...

implementation

var
  P: TPoint;
  inSelect: Boolean;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Shape1.Pen.Color := clWhite;
  Shape1.Pen.Style := psDot;
  Shape1.Visible   := False;
  inSelect         := False;
  with Image1 do
  begin
    OnMouseDown:= nil;
    OnMouseMove:= nil;
    OnMouseUp  := nil;
  end;
end;

procedure TForm1.btnLoadImageClick(Sender: TObject);
begin
  if OpenPictureDialog1.Execute then
    with Image1 do
    begin
      Picture.LoadFromFile(OpenPictureDialog1.FileName);
      OnMouseDown:= Image1MouseDown;
      OnMouseMove:= Image1MouseMove;
      OnMouseUp  := Image1MouseUp;
    end;
end;

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  InSelect:= ssCtrl in Shift;
  if InSelect then
  begin
    P.X:= X;
    P.Y:= Y;
  end
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var
  R: TRect;
begin
  if inSelect then
  begin
    with TImage(Sender) do
      R:= Rect(Left+P.X, Top+P.Y, Left+X, Top+Y);
    Shape1.BoundsRect := R;
    Shape1.Brush.Style:= bsClear;
    Shape1.Visible    := True;
  end;
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  pic: TPicture;
  bmp: TBitmap;
  img: TImage;
begin
  if inSelect and ( P.X < X )and( P.Y < Y ) then
  begin
    img:= TImage(Sender);
    pic:= TPicture.Create;
    try
      pic.Assign(img.Picture);
      bmp:= TBitmap.Create;
      try
        bmp.Height:= img.Picture.Height;
        bmp.Width := img.Picture.Width;
        bmp.Canvas.Draw(0, 0, Pic.Graphic);
        bmp.Canvas.CopyRect(Rect(0, 0, X-P.X, Y-P.Y),
          bmp.Canvas, Rect(P.X, P.Y, X, Y));
        bmp.Width := Abs(X-P.X);
        bmp.Height:= Abs(Y-P.Y);
        Image2.Picture.Bitmap.Assign(bmp);
      finally
        bmp.Free;
      end;
    finally
      pic.Free;
    end;
  end;
  Shape1.Visible:= False;
  InSelect:= False;
end;

procedure TForm1.btnCleanSelectionClick(Sender: TObject);
begin
  Image2.Picture:= nil;
end;

Para comenzar a realizar la selección debes tener la tecla Ctrl presionada (una vez comenzada la podes soltar):


Cuando levantas el botón izquierda del mouse se copia la seleccion a Image2:


Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita
  #7  
Antiguo 11-09-2014
Avatar de pacopenin
pacopenin pacopenin is offline
Miembro
 
Registrado: sep 2010
Ubicación: Asturias
Posts: 382
Poder: 17
pacopenin Va por buen camino
Gracias, ecfisa. Algo muy parecido tengo que hacer en breve y me va a resultar muy útil tu código.
__________________
http://www.gestionportable.com
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
recortar imagen kapullok_2006 Gráficos 3 12-11-2007 18:39:29
"Recortar" una imagen jplj HTML, Javascript y otros 0 11-04-2007 18:27:47
recortar una foto kapullok_2006 Gráficos 1 27-03-2007 12:45:25
Recortar Imagen fmtidona Gráficos 2 26-09-2005 19:18:20
Rectángulo para recortar imagen JAV Gráficos 3 05-07-2005 10:08:23


La franja horaria es GMT +2. Ahora son las 03:23:48.


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