It works, if we change the rc file like this:
- Code: Select all Expand view RUN
FONT 8 , "MS Sans Serif"
{
CONTROL "", 4001, "TXImage", WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 567, 232
}
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:
- Code: Select all Expand view RUN
oImage:nUserControl := 0
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
- Code: Select all Expand view RUN
oImage:FitRect()
So, retain the existing behavior of your application, every time XImage is defined, please use this code:
- Code: Select all Expand view RUN
oImage:nUserControl := 0
oImage:FitRect()
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.