TO GURUS : TRANSPARENT ERROR WITH XBROWSE

TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Silvio » Thu Jan 22, 2009 10:36 am

i MADE A GRID ( XBROWSE)
i PUT A BACKGROUNDImage


FOR EACH XBROWSE COLUMN i USE BITMAPS AS YOU SEE ON MY PICTURE
THE BITMPAS ARE NOT TRAPSRENT ON XBROWSE BACKGROUND
: WHY ?

I TRY ALSO TO REFILL EACH BITMAPS WITH 255,0,255 COLOR

ANY IDEA ?
Best Regards, Saludos

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

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby ukoenig » Thu Jan 22, 2009 1:11 pm

Hello Silvio,

some month ago, I noticed this and I have done some tests.

FWH 8.09 Xbrowse-Tests : Colors, Bitmaps and backgrounds.
------------------------------------------------------------------------
viewforum.php?f=3&start=650

Because the problem couldn't be solved to 100 %, there is still the old xBrowse-source delivered.
This problem is not solved for the moment to paint transparent BMP's on brushes.

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: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Daniel Garcia-Gil » Thu Jan 22, 2009 2:29 pm

Hello Silvio...

please try this change into class

1.- New define data
#define SRCPAINT 0x00EE0086

2.- New data Class CLASS TXBrwColumn
DATA lBmpTransparent AS LOGICAL

3.- add this line into "METHOD NEW CLASS TXBrwColumn"
::lBmpTransparent := .t.

4.- Change this line into "METHOD PAINDATA CLASS TXBrwColumn"

Code: Select all  Expand view
         PalBmpDraw( hDC, nBmpRow, nBmpCol,;
                     aBitmap[ BITMAP_HANDLE ],;
                     aBitmap[ BITMAP_PALETTE ],;
                     aBitmap[ BITMAP_WIDTH ],;
                     aBitmap[ BITMAP_HEIGHT ];
                     ,, .t., aColors[ 2 ] )

for this lines
Code: Select all  Expand view
        PalBmpDraw( hDC, nBmpRow, nBmpCol,;
                     aBitmap[ BITMAP_HANDLE ],;
                     aBitmap[ BITMAP_PALETTE ],;
                     aBitmap[ BITMAP_WIDTH ],;
                     aBitmap[ BITMAP_HEIGHT ];
                     ,if(::oBrw:lBrushed,SRCPAINT,), ::lBmpTransparent, aColors[ 2 ] )


point 2-3 are personal change
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Silvio » Thu Jan 22, 2009 2:38 pm

I change the xbrowse class
the bitmaps are not transparent

Image
Best Regards, Saludos

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

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby ukoenig » Thu Jan 22, 2009 3:19 pm

Silvio,

I tested as well with a brush :

Image

There is no difference.
You have also adjust the row-height, like You can see in the screenshot.
There is still something wrong. The row-height is calculated with the 1. image.

Image

You must get the size of the image with the greatest Height and adjust the Row-Height !!
----------------------------------------------------------------------------------------------------------
Code: Select all  Expand view
IF oBrw:nRowHeight < nBMPHight
    oBrw:nRowHeight := nBMPHight + 4
ENDIF


Regards
Uwe :cry:
Last edited by ukoenig on Thu Jan 22, 2009 7:41 pm, 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: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Antonio Linares » Thu Jan 22, 2009 6:48 pm

I think that the solution is to call TransBmp() instead of PalBmpDraw()

Try this:
oBrw:lTransparent = .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41404
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Daniel Garcia-Gil » Thu Jan 22, 2009 8:12 pm

sorry silvio... my mistake

i did test with xbrowse new feature "cBmpAdjBrush"... only work with that :(
and did aply simple imagen technical...


Code: Select all  Expand view
aBrw[ 1 ]:= txbrowse():new( oFolder:aDialogs[ 1 ] )
aBrw[ 1 ]:nRowHeight := 30
aBrw[ 1 ]:nColDividerStyle    := LINESTYLE_BLACK
aBrw[ 1 ]:nRowDividerStyle    := LINESTYLE_BLACK
aBrw[ 1 ]:SetArray( aArray1 )
aBrw[ 1 ]:cBmpAdjBrush          := "frog.bmp"
aBrw[ 1 ]:SetBackGround( "frog.bmp" )
aBrw[ 1 ]:CreateFromCode()
aBrw[ 1 ]:bClrStd                := {|| {CLR_WHITE, CLR_BLACK} }
aBrw[ 1 ]:nTop                      := 0
aBrw[ 1 ]:nLeft                     := 0
aBrw[ 1 ]:nBottom                  := 120
aBrw[ 1 ]:nRight                  := 160
aBrw[ 1 ]:aCols[ 1 ]:addbmpfile( "arrow.bmp" )
aBrw[ 1 ]:aCols[ 1 ]:addbmpfile( "bottom.bmp" )
aBrw[ 1 ]:aCols[ 1 ]:bBmpData := {|| if ( aBrw[ 1 ]:nArrayAt() % 2 == 0,2,1) }


this line is very import , is necesary param #2 are BLACK
aBrw[ 1 ]:bClrStd := {|| {CLR_WHITE, CLR_BLACK} }

Image
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby ukoenig » Thu Jan 22, 2009 9:16 pm

Hello Daniel,

I tested Your changes, but my BMP's are looking funny.
There is Transparency now, but the colors are strange looking.

Image

If You change the Row-selector / position, the Image-color is not restored.

Image

Code: Select all  Expand view
// Image
// --------
IF  nArrayPos = 9
   // To receive the Row-Height ( from biggest BMP )
   // --------------------------------------------------------
   DEFINE IMAGE oImage1 RESOURCE "Help"
   oBrw5:nRowHeight := oImage1:nWidth() + 4
   oImage1:End()
   // --------------
   oBrw5:cBmpAdjBrush := "FANTASY1.BMP"
   oBrw5:SetBackGround( "FANTASY1.BMP" )
*  aeval( oBrw5:aCols, { |o|o:lColTransparent := .t. } )
   oBrw5:aCols[ 2 ]:bClrStd := {|| {CLR_WHITE, CLR_BLACK} }
   oBrw5:aCols[ 2 ]:AddResource("Help")
   oBrw5:aCols[ 2 ]:AddResource("Calendar")
*   oBrw5[ 2 ]:aCols[ 1 ]:addbmpfile( "arrow.bmp" )
*   oBrw5[ 2 ]:aCols[ 1 ]:addbmpfile( "bottom.bmp" )
   oBrw5:aCols[2]:bBmpData := {|| if ( oBrw5:nArrayAt() % 2 == 0,2,1) }
   oBrw5:Refresh()
ENDIF


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: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Daniel Garcia-Gil » Fri Jan 23, 2009 2:28 am

Master Antonio you catched solution very very near...
when you do use BRUSH automaticly set .t. ::lTransparet

please remove last change
again... change over class

original line...( with ::lBmpTransparent DATA :) )
Code: Select all  Expand view
         PalBmpDraw( hDC, nBmpRow, nBmpCol,;
                     aBitmap[ BITMAP_HANDLE ],;
                     aBitmap[ BITMAP_PALETTE ],;
                     aBitmap[ BITMAP_WIDTH ],;
                     aBitmap[ BITMAP_HEIGHT ];
                     ,, ::lBmpTransparent, aColors[ 2 ] )


add IF sentence with new lines
Code: Select all  Expand view
   IF ::oBrw:lTransparent
         nOldColor := SetBkColor( hDC, nRGB( 255, 255, 255 ) )
         TransBmp( aBitmap[ BITMAP_HANDLE ], aBitmap[ BITMAP_WIDTH ], aBitmap[ BITMAP_HEIGHT ],;
                   aBitmap[ BITMAP_ZEROCLR ], hDC, nBmpCol, nBmpRow, aBitmap[ BITMAP_WIDTH ], ;
                   aBitmap[ BITMAP_HEIGHT ] )
         SetBkColor( hDC, nOldColor )
    else
         PalBmpDraw( hDC, nBmpRow, nBmpCol,;
                     aBitmap[ BITMAP_HANDLE ],;
                     aBitmap[ BITMAP_PALETTE ],;
                     aBitmap[ BITMAP_WIDTH ],;
                     aBitmap[ BITMAP_HEIGHT ];
                     ,, ::lBmpTransparent, aColors[ 2 ] )
   endif


now see ok with or without cBmpAdjBrush...

Image
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Silvio » Fri Jan 23, 2009 8:53 am

Now the bitmaps are transparent

When I click on a row of the xbrowse I cannot see the bitmaps
this is my configuration sample

Code: Select all  Expand view
oApp():oDlg:NewGrid( nSplit )
oApp():oGrid:nMarqueeStyle       := MARQSTYLE_HIGHLROWMS    // per la multi selezione
oApp():oGrid:nColDividerStyle    := LINESTYLE_FORECOLOR
oApp():oGrid:lColDividerComplete := .t.
oApp():oGrid:lRecordSelector := .F.

and one column :

                                         oCol:= oApp():oGrid:AddCol()
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:cHeader  := "Grado"
                                          oCol:nHeadBmpNo    := if( (oDCli)->( ORDNUMBER() ) == 7, 1, 2)
                                          oCol:nHeadBmpAlign := AL_RIGHT
                                          oCol:bLClickHeader :={ ||(Sel_Index(6,oDCli) , oApp():oTab:nOption:=6,oApp():oTab:refresh()) }
                                          oCol:AddResource("GRADO1")
                                          oCol:AddResource("GRADO2")
                                          oCol:AddResource("GRADO3")
                                          oCol:AddResource("GRADO4")
                                          oCol:AddResource("GRADO5")
                                          oCol:AddResource("GRADO6")
                                          oCol:AddResource("GRADO7")
                                          oCol:AddResource("GRADO8")
                                          oCol:AddResource("GRADO0")
                                          oCol:bStrData := { || (oDCli)->GRADO}
                                          oCol:bBmpData := { || (oDCli)->GRADO + 2}
                                          oCol:nWidth   :=40






and then at the end


oApp():oGrid:nFreeze :=3
oApp():oGrid:SetRDD()
oApp():oGrid:bClrStd := { || Colores(oDCli) }
oApp():oGrid:SetBackGround( ".\bitmaps\pclogog.BMP" )
oApp():oGrid:CreateFromCode()
oApp():oGrid:bChange    :={ || (RefreshCont(oCont,oDCli)) }
oApp():oGrid:bRClicked := {|nRow,nCol| Disp_Men(oApp():oDlg,nRow,nCol,oDCli) }
oApp():oGrid:bKeyDown   :={|nKey| Val_nKey(nKey,oApp():oDlg)}
oApp():oGrid:bSeek      :={|c| DbSeek( Upper( c ) ) }
oApp():oGrid:nRowHeight  :=40
oApp():oGrid:nHeaderHeight  := 36
oApp():oGrid:RestoreState( cState )


.......

STATIC FUNCTION Colores(cdbf)
LOCAL aCol:={}
IF  (cdbf)->(Ordkeyno()) % 2 == 0
aCol:={CLR_BLACK, RGB(193,221,255) }
ELSE
aCol:={CLR_BLACK, RGB(221,245,255) }
ENDIF
RETURN (aCol)




when I click on a row at xbrowse I see a row blu with data text NO bitmaps: ( the other rows have transparent bitmaps)
Image




the problem is wen I use this command
oApp():oGrid:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
I need it for the multiselection and to browse all data
Last edited by Silvio on Fri Jan 23, 2009 11:29 am, edited 1 time in total.
Best Regards, Saludos

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

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby ukoenig » Fri Jan 23, 2009 11:23 am

Daniel,

I have the same result like Silvio.
The dispay of the images is OK now, but the row-selection is not transparent anymore
and doesn't show the image.

Image

Regards
Uwe :cry:
Last edited by ukoenig on Sat Jan 24, 2009 10:03 am, edited 1 time 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: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Silvio » Fri Jan 23, 2009 4:57 pm

Any Idea ? :)
Best Regards, Saludos

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

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Daniel Garcia-Gil » Fri Jan 23, 2009 6:42 pm

i'm working...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby ukoenig » Sat Jan 24, 2009 10:09 am

Hello Daniel,

The transparent BMP-painting on < BRUSHES > seems to be solved as well with Your changes.
There was no < transparent > at Brushes in the last FWH-Version.

BMP-Brush
Image

STYLE-Brush
Image

Only the BMP on aktive row-position is missing.

There are some situations, it works :

MONO Color ( doesn't work )
Image

Alternated Row-Color ( Works !!! )
Image

Alternated Col-Color ( Works !!! )
Image

Code: Select all  Expand view

// Color DOESN'T WORK !!!
// ----------------------------
IF  nArrayPos = 2
   DEFINE IMAGE oImage1 RESOURCE "Help"
        oBrw5:nRowHeight := oImage1:nWidth() + 4
   oImage1:End()
   DEFINE BRUSH oBrush5 COLOR 16105859
   oBrw5:SetBackGround( oBrush5 )
   RELEASE BRUSH oBrush5
   oBrw5:aCols[ 2 ]:AddResource("Help")
   oBrw5:aCols[ 2 ]:AddResource("Calendar")
        oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }
   oBrw5:Refresh()
ENDIF

// Alternate Row-Color WORKS !!!
// ------------------------------------
IF  nArrayPos = 3
   DEFINE IMAGE oImage1 RESOURCE "Help"
        oBrw5:nRowHeight := oImage1:nWidth() + 4
   oImage1:End()
   oBrw5:nColDividerStyle    := LINESTYLE_BLACK
   oBrw5:nRowDividerStyle := LINESTYLE_BLACK
   aClrCol := { { 0, 16105859 }, { 0, 16776960 } }
   oBrw5:bClrStd := { || aClrCol[ oBrw5:KeyNo % 2 + 1 ] }
   oBrw5:aCols[ 2 ]:AddResource("Help")
   oBrw5:aCols[ 2 ]:AddResource("Calendar")
        oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }
ENDIF

// Alternate Col- Color WORKS !!!!
// -------------------------------------
IF  nArrayPos = 4
   DEFINE IMAGE oImage1 RESOURCE "Help"
        oBrw5:nRowHeight := oImage1:nWidth() + 4
   oImage1:End()
   oBrw5:nColDividerStyle    := LINESTYLE_BLACK
   oBrw5:nRowDividerStyle := LINESTYLE_BLACK
   aClrCol := { { 0, 16105859 }, { 0, 16776960 } }
   lSELECT := .T.
   FOR nFOR := 1 TO LEN( oBrw5:aCols )
      IF lSELECT = .T.
         oBrw5:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 1 + 2 ] }
         lSELECT := .F.
      ELSE
         oBrw5:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 2 + 1 ] }
         lSELECT := .T.
      ENDIF
   NEXT
   oBrw5:aCols[ 2 ]:AddResource("Help")
   oBrw5:aCols[ 2 ]:AddResource("Calendar")
        oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }   
ENDIF


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: TO GURUS : TRANSPARENT ERROR WITH XBROWSE

Postby Silvio » Sat Jan 24, 2009 5:32 pm

Dear Uwe,
How I can modify it ( as your working sample) ?

I make :

oApp():oGrid:bClrStd := { || Colores(oDCli) }

...
STATIC FUNCTION Colores(cdbf)
LOCAL aColo:={}
IF (cdbf)->(Ordkeyno()) % 2 == 0
aColo:={CLR_BLACK, RGB(193,221,255) }
ELSE
aColo:={CLR_BLACK, RGB(221,245,255) }
ENDIF
RETURN (aColo)


thanks
Best Regards, Saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests