Page 1 of 1

Error with array bitmaps

PostPosted: Fri Apr 17, 2009 9:42 am
by Silvio
I add on an array oDTipGrad the value of a dbf record (oDTipGrad)->Bitmap



Apri_Dbf("Tabelle" )
(oDTipGrad)->(DbSeek("G"))
DO WHILE (oDTipGrad)->CveTab="G" .AND. !(oDTipGrad)->(EoF())
AAdd(aGradiBmp,(oDTipGrad)->Bitmap)
(oDTipGrad)->(DbSkip())
ENDDO
Chiudi_Dbf("Tabelle",oDTipGrad)


then I create the xbrowse
and I must show the bitmap on xbrowse

oCol:= oApp():oGrid:AddCol()
oCol:AddResource("sort1") // this for Header
oCol:AddResource("sort2") // this for the header
oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( (oDVds)->( ORDNUMBER() ) == 7, 1, 2)
oCol:nHeadBmpAlign := AL_RIGHT
oCol:bLClickHeader :={ ||(Sel_Index(6,oDVds) , oApp():oTab:nOption:=6,oApp():oTab:refresh()) }

oCol:AddBmpFile(aGradiBmp[(oDVds)->GRADO])
oCol:bStrData := { || (oDVds)->GRADO}

oCol:bBmpData := { || (oDVds)->GRADO+2}
oCol:nWidth :=40


But Not run ok !!!
have you an Idea ?

Re: Error with array bitmaps

PostPosted: Fri Apr 17, 2009 10:03 am
by nageswaragunupudi
I am assuming aGradiBmp is an array of bitmap file names.
If understood you correctly, try
Code: Select all  Expand view

AEval( aGradiBmp, { |cBmpFile| oCol:AddBmpFile(cBmpFile)} )
 

instead of
Code: Select all  Expand view

oCol:AddBmpFile(aGradiBmp[(oDVds)->GRADO])
 

Re: Error with array bitmaps

PostPosted: Fri Apr 17, 2009 10:32 am
by Silvio
Nas,
Now I can show the bitmaps but
Not run ok
Perhaps not found cBmpFile

I save on aGradiBmp a string with the name of cBmpFile

sample :
".\bitmaps\gra001.bmp"

I have on dbf 27 bitmaps now
and if the odvs->grado = 9 it take the grad007.bmp instead grad009.bmp

the problem I inser two another bmp for the header bmp
oCol:AddResource("sort1")
oCol:AddResource("sort2")
and I must sum to aGradiBmp + 2

do you understand me ?

Re: Error with array bitmaps

PostPosted: Fri Apr 17, 2009 11:44 am
by nageswaragunupudi
>
sample :
".\bitmaps\gra001.bmp"

>
first please test with absolute paths. Later you can work with relative paths.

Re: Error with array bitmaps

PostPosted: Fri Apr 17, 2009 6:39 pm
by Silvio
ooopss sorry now run I made a mistake