Consulta acerca de TBitmap/Timage/Ximage
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Consulta acerca de TBitmap/Timage/Ximage
Hola amigos, acabo de actualizar a fwh 19.05 y estoy tratando de decidir cual es la mejor forma de mostrar imágenes en los diálogos.
Actualmente trabajo con una variante de tImage (tZoomImage) adaptada por Jaime Irurzun y que consigue ajustar la imagen de forma proporcional.
He probado la clase tImage en la versión actual y sigue sin ajustar de forma proporcional la imagen.
La pregunta es, ¿sigo usando tZoomimage o hay alguna clase (he visto xImage) propia de FW que ajuste de forma proporcional las imagenes?
Gracias!
Actualmente trabajo con una variante de tImage (tZoomImage) adaptada por Jaime Irurzun y que consigue ajustar la imagen de forma proporcional.
He probado la clase tImage en la versión actual y sigue sin ajustar de forma proporcional la imagen.
La pregunta es, ¿sigo usando tZoomimage o hay alguna clase (he visto xImage) propia de FW que ajuste de forma proporcional las imagenes?
Gracias!
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Gracias, primer problema (o desconocimiento) con xImage.
Cuando se crea desde recurso no hace caso a las llamadas a bRClicked o bLClicked (ni tan sólo muestra su propio menú pop).
El fichero rc
Cuando se crea desde recurso no hace caso a las llamadas a bRClicked o bLClicked (ni tan sólo muestra su propio menú pop).
Code: Select all
#include "fivewin.ch"
//----------------------------------------------------------------------------//
function Main()
Local oDlg, oImage
// Funciona bien
DEFINE DIALOG oDlg FROM 0,0 TO 40,40
@ 0,0 XIMAGE oImage FILE "image.jpg" SIZE 0,0 OF oDlg
oImage:bRClicked:={|| MsgInfo ('Hola')}
ACTIVATE DIALOG oDlg CENTERED
// No funciona el menú ni evalua mi bRClicked si lo defino
DEFINE DIALOG oDlg RESOURCE "Dialogo"
REDEFINE XIMAGE oImage ID 4001 OF oDlg FILE "image.jpg"
oImage:bRClicked:={|| MsgInfo ('Hola')}
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//
Code: Select all
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 9.00".
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
DIALOGO DIALOG DISCARDABLE 0, 0, 567, 274
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
CONTROL "", 4001, "Static", SS_BITMAP|SS_CENTERIMAGE|WS_BORDER, 0, 1, 567, 232
}
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
It works, if we change the rc file like this:
With XImage, by default, the user can move the image by mouse-drag, zoom and unzoom with mouse-scroll (or by pinch and zoom on a touch screen) and also rotate the image by shift-mouse scroll (by fingers on a touch screen). I presume you do not want to let the user disturb the image. To disable these features you need to use:
If the image is smaller than the size of the control, the image is centered. If the image is larger than the control size, the image is reduced to fit the size of the control. If you wan the image to fit whether the image is smaller or larger please use
So, retain the existing behavior of your application, every time XImage is defined, please use this code:
Note: XImage always retains the proportions when zoomed or unzoomed.
With XImage, you can use jpg, png, ico, tiff, emf files without freeimage.dll.
You can remove freeimage.dll, if you are using now.
Code: Select all
FONT 8 , "MS Sans Serif"
{
CONTROL "", 4001, "TXImage", WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 567, 232
}
Code: Select all
oImage:nUserControl := 0
Code: Select all
oImage:FitRect()
Code: Select all
oImage:nUserControl := 0
oImage:FitRect()
With XImage, you can use jpg, png, ico, tiff, emf files without freeimage.dll.
You can remove freeimage.dll, if you are using now.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Thanks Mr. Rao, now it works perfectly.
It's a really impressive job, thank you.
It's a really impressive job, thank you.
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Please see this post to see the copy/paste capabilities of ximage.
http://forums.fivetechsupport.com/viewt ... er#p222736
http://forums.fivetechsupport.com/viewt ... er#p222736
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Very useful, thanks
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
- augustogomes
- Posts: 23
- Joined: Mon Jun 06, 2016 8:38 pm
- Location: Ribeirão Preto - SP - Brasil
Re: Consulta acerca de TBitmap/Timage/Ximage
Hello people
Do you know how to use ximage with Pelles C? What feature would you use?
I tried with the bitmap feature and it gets static, doesn't work ximage features
thankful
Augusto
Olá Pessoal
Vocês sabem como usar o ximage com Pelles C ? Qual recurso usaria?
Tentei com o recurso bitmap e ele fica statico, não funciona os recurso da ximage
Grato
Augusto
Do you know how to use ximage with Pelles C? What feature would you use?
I tried with the bitmap feature and it gets static, doesn't work ximage features
thankful
Augusto
Olá Pessoal
Vocês sabem como usar o ximage com Pelles C ? Qual recurso usaria?
Tentei com o recurso bitmap e ele fica statico, não funciona os recurso da ximage
Grato
Augusto
Augusto Gomes /Suprisystem Informática - Fivewin 16.08 - xharbour 123 - BCC70 - DBFNTX e PostGreSql
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
Re: Consulta acerca de TBitmap/Timage/Ximage
Hi.nageswaragunupudi wrote: If the image is smaller than the size of the control, the image is centered. If the image is larger than the control size, the image is reduced to fit the size of the control. If you wan the image to fit whether the image is smaller or larger please useCode: Select all
oImage:FitRect()
Is there an easy way to auto fit a TImage ( not a TXImage )?
[[]] Maurício Faria
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
Re: Consulta acerca de TBitmap/Timage/Ximage
AngelSalom wrote:http://forums.fivetechsupport.com/viewt ... ge#p124637
Gracias Angel !
Según su ejemplo, escribí un método para la clase TImage:
Code: Select all
method FitRect() CLASS TImage
local nW_Bmp := nBmpWidth( ::hBitmap )
local nH_Bmp := nBmpHeight( ::hBitmap )
local aRect := GetClientRect( ::hWnd )
local nW_Wnd := aRect[4] - aRect[2]
local nH_Wnd := aRect[3] - aRect[1]
local nZoom
nZoom := ( nW_Wnd / nW_Bmp )
if ( nH_Wnd / nH_Bmp ) < nZoom
nZoom := ( nH_Wnd / nH_Bmp )
endif
::Zoom( nZoom )
::Refresh()
::ScrollAdjust()
return nil
[[]] Maurício Faria
- AngelSalom
- Posts: 664
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Vinaros (Castellón ) - España
- Contact:
Re: Consulta acerca de TBitmap/Timage/Ximage
Excelente!
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0