BRush.prg ( poder excluir freeimage.dll )

BRush.prg ( poder excluir freeimage.dll )

Postby mastintin » Mon May 11, 2015 8:39 am

un pequeño cambio en brush.prg
en el metodo new...linea 183 +-

Code: Select all  Expand view


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


 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: BRush.prg ( poder excluir freeimage.dll )

Postby mastintin » Mon May 11, 2015 9: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: Select all  Expand view


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 )

:D
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: BRush.prg ( poder excluir freeimage.dll )

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: BRush.prg ( poder excluir freeimage.dll )

Postby acuellar » Mon May 11, 2015 3:55 pm

Muchas Gracias Manuel

Con:
Code: Select all  Expand view

DEFINE BRUSH oBrush FILE "D:\Sistemas\IMAGENES\BITMAPS\ORIENTE.BMP" STRETCH //No pide freeimage.dll con RESOURCE también
 


Saludos,

Adhemar
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1594
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: BRush.prg ( poder excluir freeimage.dll )

Postby acuellar » Mon May 11, 2015 6: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.
User avatar
acuellar
 
Posts: 1594
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: BRush.prg ( poder excluir freeimage.dll )

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests