FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Last FWH version. Memory leak.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Last FWH version. Memory leak.
Posted: Fri Feb 15, 2013 09:31 PM

Carlos,

Si, de hecho en las modificaciones nuestras ya lo hemos eliminado :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Last FWH version. Memory leak.
Posted: Wed Feb 20, 2013 10:22 AM

Hi Antonio,
I didn't understand if the problem has been solved and if affirmative which is the new code to use. Thanks.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Last FWH version. Memory leak.
Posted: Wed Feb 20, 2013 11:54 AM
Marco,

Solved. There was a bug in the code and we have shown how to fix it :-)

It will be included in FWH 13.02

This code has to be replaced in FWH\source\function\fwbmp.c
Code (fw): Select all Collapse
void TransBmp( HBITMAP hBitmap, int iXsize, int iYsize,
               COLORREF rgbTransparent, HDC hDC,
               int iXOffset, int iYOffset, int iWidth, int iHeight )
{
  HDC mDC, nDC;
  HBITMAP hMask, hBmOld1, hBmOld2;

  mDC = CreateCompatibleDC( hDC );
  
  if( mDC )
  {
    hBmOld1 = ( HBITMAP ) SelectObject( mDC, hBitmap );

    hMask = CreateBitmap( iXsize, iYsize, 1, 1, NULL );
    
    if( hMask )
    {
       nDC = CreateCompatibleDC( hDC );
        
       if( nDC )
       {
          hBmOld2 = ( HBITMAP ) SelectObject( nDC, hMask );
          SetBkColor( mDC, rgbTransparent );

          BitBlt( nDC, 0, 0, iXsize, iYsize, mDC, 0, 0, SRCCOPY );

          SetStretchBltMode( hDC, COLORONCOLOR );

          StretchBlt( hDC, iXOffset, iYOffset, iWidth, iHeight,
                      mDC, 0, 0, iXsize, iYsize,
                      SRCINVERT );

          StretchBlt( hDC, iXOffset, iYOffset, iWidth, iHeight,
                      nDC, 0, 0, iXsize, iYsize,
                      SRCAND );

          StretchBlt( hDC, iXOffset, iYOffset, iWidth, iHeight,
                      mDC, 0, 0, iXsize, iYsize,
                      SRCINVERT );

          SelectObject( nDC, hBmOld2 );
          DeleteDC( nDC );
        }
        DeleteObject( hMask );
    }
    SelectObject( mDC, hBmOld1 );
    DeleteDC( mDC );
  }
}
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion