show a bitmap

show a bitmap

Postby Silvio » Sun Oct 04, 2009 6: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: show a bitmap

Postby ukoenig » Mon Oct 05, 2009 7:14 am

Hello Silvio,

The Bitmap-Preview and Edit :

Image

Code: Select all  Expand view

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 :lol:
Last edited by ukoenig on Mon Oct 05, 2009 9:09 am, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: show a bitmap

Postby Silvio » Mon Oct 05, 2009 8:13 am

thanks a lot!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: show a bitmap

Postby ukoenig » Mon Oct 05, 2009 9: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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: show a bitmap

Postby Silvio » Mon Oct 05, 2009 9:44 am

this afternoon I try it
thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests

cron