Cristobal,
sorry, I still don't understand your problem. ![]()
EMG
Cristobal,
sorry, I still don't understand your problem. ![]()
EMG
Enrico
Puedes ver otra vez los enlaces de mi post anterior?
Estan actualizadas
Disculpa mi ingles
You can see again the links of my previous post?
are updated
Sorry for my English
Cristobal,
what I understood is that you want to resize the TImage control so it gets the same size of the image, right? Now, can you build a little sample showing the exact problem?
EMG
Sí
En el ejemplo inicial que tu has puesto y en los que yo he añadido el tamaño del control no coincide con el tamaño de la imagen que se quiere mostrar
Yo puedo hacer que el tamaño del control sea igual al tamaño de la imagen si en el ON INIT del DIALOG añado el oImage:SetSize( .... ), pero el control deberia dibujarse con el mismo tamaño que la imagen que quieres cargar.
yes
In the initial example that you have set and in which I added the size of the control does not match the size of the image to be shown
I can make the size of the check is equal to the size of the image if the ON INIT of DIALOG add the oImage: SetSize (....), but the control should be drawn with the same size as the image you want to upload.

STATIC FUNCTION SHOW_IMGAGE(oDlg, cDestFile)
LOCAL oDlg1, oTest, nImgWidth, nImgHeight
DEFINE IMAGE oTest FILENAME c_Path1 + cDestFile
// needed for dialog-size
nImgWidth := oTest:nWidth
nImgHeight := oTest:nHeight
// is used, to make it possible, to show a image RESIZED
oBrush := TBrush():new( ,,,, ResizeBmp( oTest:hBitmap, nImgWidth, nImgHeight, .T. ) )
oTest:End()
DEFINE DIALOG oDlg1 TITLE "EXPORT-IMAGE" FROM 0, 0 TO nImgHeight, nImgWidth PIXEL
ACTIVATE DIALOG oDlg1 CENTER ;
ON INIT oDlg1:SetBrush( oBrush )
oBrush:End()
RETURN( NIL )cnavarro wrote:but the control should be drawn with the same size as the image you want to upload.
Thanks for your interest
AUTORESIZE clause?
Well, it may be, I want to load an image of 150x100, for example, and the control that contains it also has the size 150x100, nothing more.
Gracias por tu interes
Claúsula AUTORESIZE?
Bien, puede ser, yo quiero cargar una imagen de 150x100, por ejemplo, y que el control que lo contiene tenga también ese tamaño 150x100, nada mas.
cnavarro wrote:Thanks for your interest
AUTORESIZE clause?
Well, it may be, I want to load an image of 150x100, for example, and the control that contains it also has the size 150x100, nothing more.
Enrico
Sure I'll use SetSize, I was just researching and asking if anyone knew that the monitoring was twice the size of the image, or was I knew not use the IMAGE command.
And also, by investigating the size of the image you get in C has 4 pixels less in width and height than that obtained in FWH
Thanks again
Claro que voy a usar SetSize, solo estaba investigando y preguntando si alguien sabia por que el control era doble de tamaño que la imagen, o era que yo no sabia usar el comando IMAGE.
Y tambien, investigaba por que el tamaño de la imagen que obtengo en C tiene 4 pixeles menos en ancho y alto que la que se obtiene en FWH
Gracias otra vez
cnavarro wrote:Enrico
Sure I'll use SetSize, I was just researching and asking if anyone knew that the monitoring was twice the size of the image, or was I knew not use the IMAGE command.
cnavarro wrote:And also, by investigating the size of the image you get in C has 4 pixels less in width and height than that obtained in FWH
Enrico Maria Giordano wrote:Cristobal,
I already answered: TImage, as any other control, doesn't automatically resize to its content.
EMG
ukoenig wrote:Cristobal,
this solution is included : a preview of the exported image.
I'm showing a little 3D-effect at the imageborder, but it can be flat.
Like You can see, it is the same size, embedded inside the dialog.
I got extended test as well, in case You want to show ALPABLENDED bmp's
Best regards
Uwe
cnavarro wrote:Prepare an example you can compile

Enrico, Uwe
https://www.dropbox.com/s/08ktrtffzgl1fsx/IMAGEN2.zip
Esta preparado para compilar con Borland o con VS2012
This ready to compile with Borland or VS2012
Mira el fichero TImage2.png
https://www.dropbox.com/s/6607scps9ns3hf7/Timage2.png
View TImage2.png file
Ejecutas Imagen2.exe
Pulsa Draw
Pulsa Save Fw -> ( crea ImageFw.jpg )
Pulsa C -> ( crea ImageC.bmp )
Pulsa Exit
Abre los ficheros ImageFw.jpg e ImageC.bmp y comprueba las imágenes y los tamaños
Run Imagen2.exe
Click Draw
Click Save Fw ->(create ImageFw.jpg)
Press C ->(create ImageC.bmp)
Click Exit
Open ImageFw.jpg ImageC.bmp files and check the images and sizes