Hires

Hires

Postby Silvio » Fri Jan 18, 2008 11:21 am

Dear Antonio,

I saw on directory fw\bitmaps there are many png files

we have support for it

How we can show it trasparent into a dialog ?
Best Regards, Saludos

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

Re: Hires

Postby Enrico Maria Giordano » Fri Jan 18, 2008 12:45 pm

Did you try using TImage?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8317
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Fri Jan 18, 2008 12:53 pm

YES

it is no trasparent with this files
Best Regards, Saludos

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

Postby Enrico Maria Giordano » Fri Jan 18, 2008 4:15 pm

You are right. The effect is only partially transparent. I don't know how to get the full transparency effect. Antonio?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8317
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Jan 18, 2008 7:31 pm

Me neither, but we will discover it :-)
regards, saludos

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

Postby toninhofwi » Sun Feb 03, 2008 6:57 pm

Antonio Linares wrote:Me neither, but we will discover it :-)

Dear Antonio,

Here is the source code that, maybe can help you. With it I can display 32bits bitmaps under windows XP.

Best regards,

Toninho.

---cut---
typedef int (_stdcall *ALPHABLEND) ( HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);

static ALPHABLEND pAlphaBlend = NULL;

void DrawAlphaBlend( HDC hDC, HBITMAP hBitmap, int iCol, int iRow )
{
HDC hDcMem;
BITMAP bm;
HBITMAP hBmpOld;
RECT rct;

BLENDFUNCTION bf;

pAlphaBlend = ( ALPHABLEND ) GetProcAddress( LoadLibrary( "MSIMG32.DLL" ), "AlphaBlend" );

GetObject( ( HGDIOBJ ) hBitmap, sizeof( BITMAP ), ( LPSTR ) &bm );

hDcMem = CreateCompatibleDC( hDC );

hBmpOld = ( HBITMAP ) SelectObject( hDcMem, ( HGDIOBJ ) hBitmap );

bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = 255;
bf.AlphaFormat = AC_SRC_ALPHA;

pAlphaBlend( hDC, iRow, iCol, bm.bmWidth, bm.bmHeight, hDcMem, 0, 0, bm.bmWidth, bm.bmHeight, bf );

SelectObject( hDcMem, hBmpOld );

DeleteDC( hDcMem );

}


HB_FUNC( DRAWALPHA )
{
DrawAlphaBlend( ( HDC ) hb_parnl( 1 ), ( HBITMAP ) hb_parnl( 2 ), 0, 0 );

hb_retl( 1 );
}

---cut---
toninhofwi
 
Posts: 170
Joined: Tue Oct 18, 2005 10:01 am

Postby Antonio Linares » Sun Feb 03, 2008 7:03 pm

Toninho,

Thanks! :-)
regards, saludos

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

Postby Silvio » Sun Feb 03, 2008 11:10 pm

Antonio,
I not understand ...
with this func how now I can show an Hires transparent ?
Best Regards, Saludos

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

Postby toninhofwi » Sun Feb 10, 2008 3:54 pm

Silvio wrote:Antonio,
I not understand ...
with this func how now I can show an Hires transparent ?

Silvio,

You can use it instead DrawBitmap() function. But it displays only 32bit bitmaps with transparencies, not png files. Maybe maestro Antonio can optimize it for us :P

Regards,

Toninho.
toninhofwi
 
Posts: 170
Joined: Tue Oct 18, 2005 10:01 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 15 guests