Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 27-08-2012
lisette lisette is offline
Miembro
NULL
 
Registrado: feb 2012
Posts: 16
Poder: 0
lisette Va por buen camino
Imagen con efecto zoom

necesito que la imagen tenga un efecto de acercamiento. Tiene que ser en BCB
Responder Con Cita
  #2  
Antiguo 27-08-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 36
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 lisette.

Revisa esto: Zoom on an Image

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita
  #3  
Antiguo 28-08-2012
lisette lisette is offline
Miembro
NULL
 
Registrado: feb 2012
Posts: 16
Poder: 0
lisette Va por buen camino
Zoom de Imagen

Dengo el siquiente codigo perteneciente a al cpp
Código Delphi [-]
//-------------------------------------------------------------------------- 
- 

#include  
#pragma hdrstop 

#include "Unit1.h" 
//-------------------------------------------------------------------------- 
- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TfrmMain *frmMain; 
//-------------------------------------------------------------------------- 
- 
Graphics::TBitmap* bmpSource = NULL; 
TRect rctZoom; 
TRect rctOldZoom; 
__fastcall TfrmMain::TfrmMain(TComponent* Owner) 
: TForm(Owner) 
{ 
img1->Width = 100; 
img1->Height = 100; 
img1->Left = 0; 
img1->Top = 0; 
img1->Stretch = false; 

bmpSource = new Graphics::TBitmap(); 
bmpSource->LoadFromFile("C:\Program Files\Common Files\Borland 
Shared\Images\Splash\256Color\factory.bmp"); 
ZoomAllTheWayOut(); 
} 
//-------------------------------------------------------------------------- 
- 
__fastcall TfrmMain::~TfrmMain() 
{ 
if(bmpSource) 
delete bmpSource; 
} 
//-------------------------------------------------------------------------- 
- 
void __fastcall TfrmMain::ZoomAllTheWayOut() 
{ 
rctZoom.Left = 0; 
rctZoom.Top = 0; 
rctZoom.Right = bmpSource->Width -1; 
rctZoom.Bottom = bmpSource->Height -1; 
rctOldZoom = rctZoom; 
RedrawImage(); 
} 
//-------------------------------------------------------------------------- 
- 
void __fastcall TfrmMain::btnZoomAllTheWayOutClick(TObject *Sender) 
{ 
ZoomAllTheWayOut(); 
} 
//-------------------------------------------------------------------------- 
- 
void __fastcall TfrmMain::RedrawImage() 
{ 
HDC hdcDest = img1->Canvas->Handle; 
HDC hdcSrc = bmpSource->Canvas->Handle; 

StretchBlt(hdcDest, 0, 0, img1->Width -1, img1->Height -1, 
hdcSrc, rctZoom.Left, rctZoom.Top, rctZoom.Right, 
rctZoom.Bottom, 
SRCCOPY); 
img1->Invalidate(); 
} 
//-------------------------------------------------------------------------- 
- 
void __fastcall TfrmMain::img1MouseDown(TObject *Sender, 
TMouseButton Button, TShiftState Shift, int X, int Y) 
{ 
rctZoom.Left = X; 
rctZoom.Top = Y; 
} 
//-------------------------------------------------------------------------- 
- 
void __fastcall TfrmMain::img1MouseUp(TObject *Sender, TMouseButton Button, 
TShiftState Shift, int X, int Y) 
{ 
rctZoom.Right = X; 
rctZoom.Bottom = Y; 

rctZoom.Left = (rctOldZoom.Right - rctOldZoom.Left) / (double)img1->Width 
* rctZoom.Left + rctOldZoom.Left; 
rctZoom.Right = (rctOldZoom.Right - rctOldZoom.Left) / (double)img1->Width 
* rctZoom.Right + rctOldZoom.Left; 
rctZoom.Top = (rctOldZoom.Bottom - rctOldZoom.Top) / (double)img1->Height 
* rctZoom.Top + rctOldZoom.Top; 
rctZoom.Bottom = (rctOldZoom.Bottom - rctOldZoom.Top) / 
(double)img1->Height * rctZoom.Bottom + rctOldZoom.Top; 

rctOldZoom = rctZoom; 

RedrawImage(); 
} 
//--------------------------------------------------------------------------

Pero no tengo la .h que es donde se encuentra la declaracion de estas dos funciones ZoomAllTheWayOut() y RedrawImage().

Alguna idea de como declarar estas funciones?
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Zoom de pantalla Nbull Varios 10 15-01-2023 19:55:59
Zoom en la imagen fasthorse Gráficos 6 07-08-2008 14:32:18
Imagen a blanco y negro y zoom fasthorse Gráficos 1 24-04-2008 05:23:41
zoom a imagen kapullok_2006 Gráficos 4 04-04-2007 06:17:31
Imágenes con zoom mutant09 Gráficos 2 28-05-2004 19:11:34


La franja horaria es GMT +2. Ahora son las 07:28:23.


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