FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Viewing Bitmaps
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Viewing Bitmaps
Posted: Thu Oct 30, 2025 03:13 PM
I have been struggling with display a bitmap of scanned invoices. Some are 8.5 by 11, others are 8.5 by 14. Using the code below when I call oBmp:oVScroll:GoBottom() it does not go all the way to the bottom of an 8.5 by 14 document. However if I click on the scrollbar it goes all the way to the bottom of the page. I would like to bring up the window with the bitmap and scroll all the way to the bottom (usualy where the amount owed appears) without having to click. Is this possible? Thanks.
Function BmpView( cFile,cTitle )
	Local oBmp            := nil
	Local oWin            := nil
	Local nDeskTopHeight  := 1080
	Local nScrollBarWidth := 35
	Default cTitle := "View Bitmap"
	Begin Sequence
		Define Window    oWin From 0,0 to 10,20 Title cTitle
		@ 0,0 Image oBmp Filename cFile Of oWin Size 0,0 Pixel Scroll
		Activate Window oWin On Init ( oWin:Move( 0,0,oBmp:nWidth + nScrollBarWidth, Min( oBmp:nHeight,nDesktopHeight ) ),oBmp:AdjClient() )
		oBmp:oVScroll:GoBottom()
		oBmp:oVScroll:Refresh()
	End Sequence
Return oWin
Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Viewing Bitmaps
Posted: Fri Oct 31, 2025 01:31 PM
Dear Byron,

Trying to reproduce it here using this code:

byron.prg
#include "FiveWin.ch"

function Main()

   local oWin, oBmp, cFile := "c:\fwh\bitmaps\fivewin.bmp" 

   DEFINE WINDOW oWin FROM 0,0 to 15,30 TITLE "test"

   @ 0,0 IMAGE oBmp FILENAME cFile OF oWin PIXEL SCROLL
	
   ACTIVATE WINDOW oWin CENTER ON RESIZE ( oBmp:oVScroll:GoBottom(), oBmp:Refresh() )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Viewing Bitmaps
Posted: Fri Oct 31, 2025 01:46 PM

Tried, it moves the Vertical ScrollBar indicator to the bottom of the window, but it is not all the way down to the bottom of the bitmap. However if you click anywhere on the ScrollBar twice, first set the Vertical ScrollBar to the Top, then again sets the Vertical ScrollBar to the bottom and displays the very bottom of the bitmap. Behaves that same as mine except the window sizing is not present.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Viewing Bitmaps
Posted: Fri Oct 31, 2025 02:59 PM
Look this,
// C:\FWH\SAMPLES\BYRON2.PRG - Thanks Mister Rao.

#include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oBmp, cFile := "..\bitmaps\fivewin.bmp"

   DEFINE WINDOW oWnd FROM 0, 0 TO 15, 32 TITLE "BitMap"

   @ 0,0 IMAGE oBmp FILENAME cFile OF oWnd PIXEL SCROLL

   oWnd:oClient   := oBmp
   oBmp:nVStep    := 20
   oBmp:nHStep    := 20
   oBmp:aControls := {}

   oBmp:oVScroll:bGoDown = { || If( oBmp:nX > -oBmp:nXExtra(),;
                             AEval( oBmp:aControls,;
                             { | o | o:nTop -= 20 } ),) }

   oBmp:oVScroll:bGoUp   = { || If( oBmp:nX != 0,;
                             AEval( oBmp:aControls,;
                             { | o | o:nTop += 20 } ),) }

   ACTIVATE WINDOW oWnd CENTERED

RETURN NIL

// FIN /END - kapiabafwh@gmail.com
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion