There is a TImage object (not xImage). As you can zoom/unzoom it ?
There is a TImage object (not xImage). As you can zoom/unzoom it ?
look samples\ximage01.prg

Natter wrote:There is a TImage object (not xImage). As you can zoom/unzoom it ?
I did zoom to TImage using StretchBlt(), but unzoom does not work
oImg:nZoom++/oImg:nZoom++, oImg:refresh() - for TImage not work
Use a brush good idea, but I was not able to interactively change its size.
Probably for zoom/unzoom you can use SaveWindow. Save need rectangl context in BMP, and then load in TImage




Beautiful, but not exactly what I wanted. My TImage stretch to fit the dialog. I would like to cut, more or less, TImage rectangle and stretch it to fit the dialog.
There is a TImage object (not xImage). As you can zoom/unzoom it ?
not exactly what I wanted. My TImage stretch to fit the dialog. I would like to cut, more or less, TImage rectangle and stretch it to fit the dialog.
There is a picture. It is larger than the screen (so I show it in TImage stretch to full screen) . I would like to cut a larger or smaller rectangle of the picture and stretch it to fit the window (something similar is done in the example zoom2.prg)
DEFINE BRUSH oBrush FILE "olga1.jpg" RESIZE // use your image file
DEFINE WINDOW oWnd BRUSH oBrush // window or dialog of your specified size
ACTIVATE WINDOW oWnd CENTERED
RELEASE BRUSH oBrushThanks for the help. This program is quite normal increases/decreases the image
oImg:=TImage():New(...)
oImg:Progress(.F.)
oImg:Cargo:=0
oImg:bMouseWheel = {| nKey, nDelta, nXPos, nYPos | Test()}
procedure Test(nDelta)
local cnt
local nWidth, nHeight // The sizes TImage on dialog
local hDC
if (nDelta<0.and.oImg:Cargo-1>=0).or. (nDelta>0.and.oImg:Cargo+1<=14)
if oImg:Cargo!=0.and.nDelta<0
oImg:Refresh()
Vrt_Dlg()
endif
hDC:=GetDC(oImg:hWnd)
cnt:=oImg:Cargo+=iif(nDelta<0, -1, 1)
StretchBlt( hDC, 0, 0, nWidth, nHeight, ;
hDC, ;
30*cnt, 30*cnt, ;
nWidth-(30*cnt*2), ;
nHeight-(30*cnt*2), 13369376 )
oImg:ReleaseDC()
endif
RETURN
procedure Vrt_Dlg
local oVrt
DEFINE DIALOG oVrt FROM 0,0 TO 0,0 PIXEL
ACTIVATE DIALOG oVrt ON INIT oVrt:End()
return