Page 2 of 2

Re: TestTitl.prg Sample MDI

PostPosted: Thu Mar 01, 2012 3:58 am
by anserkk
Dear Mr.Rick,

Rick Lipkin wrote:I have no clue why the toolbar class is not showing up with transparent icons like yours :(
Thanks
Rick


What about the resource compiler used by you ? Does it support Alpha channel ?

Regards
Anser

Re: TestTitl.prg Sample MDI

PostPosted: Thu Mar 01, 2012 11:39 am
by ukoenig
Rick,

You can use these BMP-styles as well :

Image

Best regards
Uwe :lol:

Re: TestTitl.prg Sample MDI

PostPosted: Thu Mar 01, 2012 1:46 pm
by Rick Lipkin
Anser

I am creating and using successfully 24 bit alpha blend icons derived from .png with Gimp photo editor then adding the the .bmp using Resedit to insert them into .rc

All I am doing at this point is adding the .rc that contains my icons into my project to be compiled with the standard Borland 582. I tested the Toolbar class with those very same alpha blend icons that work in the buttonbar class.

I do not know why the toolbar class will not show transparent icons :(

Rick Lipkin

Re: TestTitl.prg Sample MDI

PostPosted: Fri Mar 02, 2012 5:02 pm
by ukoenig
Rick,

with some more Tests, I found what's wrong : TRANSPARENT BMP
I repainted a original 24 Bit transparent BMP.

Image

oImageList = TImageList():New( 32, 32 ) // width and height of bitmaps

From Resource
-----------------
oImageList:AddMasked( TBitmap():Define( "New", , oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Open", , oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Check", , oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Search", , oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Print", , oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Internet", ,oWnd ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "Keys", , oWnd ), nRGB( 255, 0, 255 ) )

From Code 24 Bit transparent ( Alphablended ) Doesn't work because of nRGB( 255, 0, 255 ) !!!
---------------------------------------------------------------------------
oImageList:AddMasked( TBitmap():Define( ,c_path + "\Images\Select.bmp", oWnd ), nRGB( 255, 0, 255 ) )

From Code 24 Bit with purple Background ( repainted No transparent ) Works !!!
------------------------------------------------------------------------------------------
oImageList:AddMasked( TBitmap():Define( ,c_path + "\Images\Select1.bmp", oWnd ), nRGB( 255, 0, 255 ) )

oImageList:AddMasked( TBitmap():Define( ,c_path + "\Images\Quit.bmp", oWnd ), nRGB( 255, 0, 255 ) )

changed :
oImageList:AddMasked( TBitmap():Define( ,c_path + "\Images\Select.bmp", oWnd ), nRGB( 255, 0, 255 ) )
against :
oImageList:AddMasked( TImage():Define( ,c_path + "\Images\Select.bmp", oWnd ) )

Image

Best Regards
Uwe :!:

Re: TestTitl.prg Sample MDI

PostPosted: Fri Mar 02, 2012 8:10 pm
by Rick Lipkin
Uwe

Interesting discovery .. just curious why the default icons used in the original sample would not work .. they were taken from the Fwh\Bitmaps folder and were purple background ?

Rick

Re: TestTitl.prg Sample MDI

PostPosted: Fri Mar 02, 2012 8:24 pm
by ukoenig
Rick,

The used BMP's from Sub-folder 32 x 32 :
Image

nRGB( 255, 0, 255 ) defines a Image-background.
That is the Reason, a Alphachannel is ignored.

using :
oImageList:Add( TImage():Define( ,c_path + "\Images\Select.bmp", oWnd ) )
Alphablended BMP's are painted, but the Border is not 100 %.

Best Regards
Uwe :lol: