FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour BRush.prg ( poder excluir freeimage.dll )
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 08:39 AM
un pequeño cambio en brush.prg
en el metodo new...linea 183 +-

Code (fw): Select all Collapse
local hGDIBmp
  ........

      case cBmpFile != nil
           if File( cBmpFile )
               if Lower( cFileExt( cBmpFile ) ) == 'bmp'
                  ::hBitMap = ReadBitmap( 0, cBmpFile )
               elseif  UseGDI() .AND. UPPER( cFileExt( cBmpFile ) ) $ "PNG,JPG,EMF,WMF,JPEG" // nuevo
                 hGDIBmp:= GdiPlusImageLoadCachedFile( cBmpFile )
                  ::hBitmap := GdiPlusCreateHBitmapImage( hGDIBmp )
                  GdiPlusImageDispose( hGDIBmp )              
               else                                                // fin nuevo 
                  ::hBitmap = FILoadImg( cBmpFile, @nFormat )
                  ::nBmpFormat = nFormat
               endif
               ::hBrush = If( ::hBitmap != 0, CreatePatternBrush( ::hBitmap ), )
           endif
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 09:33 AM
y un par de tips para cuellar ....
si quieres tener el brush dentro de un blob ( como las fotos ) .
Se recuperaria facilmente de esta forma

Code (fw): Select all Collapse
local cStr := oFONDOS:FONDO
DEFINE BRUSH oBrush GRADIENT hbmpGDIStr(  cStr  )

FUNCTION hbmpGDIStr( cStr )

   local hGDIBmp := GdiPlusImageLFromStr( cStr, len( cStr ) )
   local hBitmap := GdiPlusCreateHBitmapImage( hGDIBmp )
                    GdiPlusImageDispose( hGDIBmp )
RETURN hBitmap


Si quieres evitar tener que introducir los cambios propuestos en el brush.prg y asi todo saltar el uso de freeimage en los brush existe una alternativa.

DEFINE BRUSH oBrush GRADIENT GDIcFileResizehBmp ( cFileImage )

:-)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 11:02 AM

Instead of making small changes like this to use GDI+, I prefer to adopt GDI+ everywhere for all image formats and then change all FWH libraries.

Surely I need your help. I am about to write email to you personally.

I am badly stuck up with handling AlphaBitmaps. Once we cross this hurdle, with your help, we can make good progress in adopting GDI+.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 03:55 PM
Muchas Gracias Manuel

Con:
Code (fw): Select all Collapse
DEFINE BRUSH oBrush FILE "D:\Sistemas\IMAGENES\BITMAPS\ORIENTE.BMP" STRETCH //No pide freeimage.dll con RESOURCE también


Saludos,

Adhemar
Saludos,



Adhemar C.
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 06:00 PM

Manuel

Me topé con otro.
En un xBrowse cargo un listado para su vista previa y en los saltos de página Chr(12) pide freeimage.dll

Gracias por la ayuda.

Saludos,

Adhemar

Saludos,



Adhemar C.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BRush.prg ( poder excluir freeimage.dll )
Posted: Mon May 11, 2015 11:23 PM
acuellar wrote:Manuel

Me topé con otro.
En un xBrowse cargo un listado para su vista previa y en los saltos de página Chr(12) pide freeimage.dll

Gracias por la ayuda.

Saludos,

Adhemar

We shall take care of this in future releases.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion