FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour show a bitmap
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
show a bitmap
Posted: Sun Oct 04, 2009 06:45 PM

I want show a bitmap on xbrowse

I make a simply dbf with this structure

cod c 4
bitmap c 60

on firstrecord there is

cod bitmap
1 .\bitmaps\test1.bmp

Can I show this dbf on a xbrowse showing the bitmap ?

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: show a bitmap
Posted: Mon Oct 05, 2009 07:14 AM
Hello Silvio,

The Bitmap-Preview and Edit :



Code (fw): Select all Collapse
DBSELECTAREA( 1 )
oLbx70 := TXBrowse():New( oFld:aDialogs[6] )

oLbx70:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx70:nColDividerStyle := LINESTYLE_BLACK
oLbx70:nRowDividerStyle := LINESTYLE_BLACK

oLbx70:bClrSelFocus = { || { 0, 16777215 } } 
oLbx70:bClrSel = { || { 0, 10853885 } } 
oLbx70:nRecSelColor = 15512898 

oLbx70:lHScroll := .F.
oLbx70:lVScroll := .T.
oLbx70:lFooter := .T.
oLbx70:nRowHeight := 40
oLbx70:nFooterHeight := 7

// BMP - Number

oCol := oLbx70:AddCol()
oCol:cHeader  := "No."
oCol:bStrData  := { || (1)->POSITION }
oCol:nWidth  := 25

// BMP - Picture

oCol := oLbx70:AddCol()
oCol:cHeader  := "Bmp"
oCol:nWidth := 50
oCol:nEditType  := TYPE_IMAGE
oCol:lBmpStretch  := .f.
oCol:lBmpTransparent := .t.
oCol:nDataBmpAlign := AL_CENTER
oCol:bStrImage := {|oCol, oLbx70| ALLTRIM((1)->FILE) }

// BMP - File

oCol := oLbx70:AddCol()
oCol:cHeader  := "File"
oCol:bStrData  := { || (1)->FILE }
oCol:nWidth  := 365
oCol:nEditType := EDIT_BUTTON
oCol:bEditBlock := {|nRow, nCol, oCol| oCol:Value := GET_BMP(oLbx70) }

// BMP - Top

oCol := oLbx70:AddCol()
oCol:cHeader  := "Top"
oCol:bStrData  := { || (1)->TOPPOS }
oCol:nWidth  := 40
oCol:nDataStrAlign := AL_RIGHT
oCol:nEditType := EDIT_GET 
oCol:bOnPostEdit := {|o, v| (DBRLOCK(), (1)->TOPPOS := v, DBUNLOCK() ) }

// BMP - Left

oCol := oLbx70:AddCol()
oCol:cHeader  := "Left"
oCol:bStrData  := { || (1)->LEFTPOS }
oCol:nWidth  := 40
oCol:nDataStrAlign := AL_RIGHT
oCol:nEditType := EDIT_GET 
oCol:bOnPostEdit := {|o, v| (DBRLOCK(), (1)->LEFTPOS := v, DBUNLOCK() ) }

aClrCol := { { 0, 16645846 }, { 0, 16512964 } }
oLbx70:bClrStd := { || aClrCol[ oLbx70:KeyNo % 2 + 1 ] } 

oLbx70:CreateFromResource( 110 )
...
...
// ----------------------------------

FUNCTION GET_BMP( oLbx70 )
cBMP := cGetFile32("BMP (*.bmp)|*.bmp|","Select a Picture" ,, "\" + CurDir() + "\IMAGES\")
DBRLOCK() 
(1)->FILE := cBMP
DBUNLOCK() 
RETURN ( cBMP )


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: show a bitmap
Posted: Mon Oct 05, 2009 08:13 AM

thanks a lot!

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: show a bitmap
Posted: Mon Oct 05, 2009 09:03 AM
Silvio,

a mistake in writing, for changing a BMP :

Must be the Filename and not the BMP-Field

oCol:bStrImage := {|oCol, oLbx70| ALLTRIM((1)->FILE) }

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: show a bitmap
Posted: Mon Oct 05, 2009 09:44 AM

this afternoon I try it
thanks

Best Regards, Saludos



Falconi Silvio

Continue the discussion