FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Salvar bitmap from resources transparent
Posts: 253
Joined: Fri Feb 03, 2006 04:21 PM
Salvar bitmap from resources transparent
Posted: Fri Nov 18, 2022 08:08 PM
Hello

I'm trying to record the bitmaps I have with transparent brackground, some and know how to do that?

I'll use it on the pages and there is a gray appearing in the background.
Code (fw): Select all Collapse
/*  ============================================================================== */
Function BmpTOFile( cNome, xhDC )
/*  ============================================================================== */
  local hDC, hDIB
  local cFile     := Lower("c:\xampp\htdocs\img\" + cNome + ".bmp")

  local cFileHtml := Lower('/img/'   + cNome + ".bmp")
  
  if File( cFile ) ; return Lower(cNome) ; Endif
  
  DEFAULT xhDC := 0
  
  if xhDC == 0
     hDC      := LoadBitMap( GetResources(), cNome )                     
  Else
     hDC      := xhDC
  Endif

  if empty( hDC ) ; return Lower(cNome) ; Endif
      
  hDIB        := DibFromBitmap( hDC, 255 )

  DibWrite( cFile, hDIB )
  
return Lower(cNome)
Thanks,
Ari

FWH 2501 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br

Continue the discussion