FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TImageList
Posts: 172
Joined: Fri Oct 07, 2005 12:00 PM
TImageList
Posted: Tue Jan 31, 2006 09:40 PM
Hola

He hecho un añadido a la clase TImageList, creo que es interesante. Se le puede pasar un bitmap para que tome los dibujos de él en lugar de ir añadiendo elementos de uno en uno. Si necesitas 20 imágenes se hace un bitmap de (20*16) de ancho por 16 de alto y con el fondo del color que indiques en el cuarto parámetro.

METHOD New( nWidth, nHeight, cFileName, nColor ) CLASS TImageList

   DEFAULT nWidth := 16, nHeight := 16
   DEFAULT nColor := RGB(255,0,255)

   ::nWidth := nWidth
   ::nHeight := nHeight

   if file( cFileName )
      ::hImageList := ReadImageList( cFileName, nWidth, 10, nColor )
   else
      ::hImageList = ILCreate( nWidth, nHeight )
   endif
   ::aBitmaps   = {}

return Self


#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#include <commctrl.h>


HB_FUNC( READIMAGELIST )
{

   hb_retnl( (long) ImageList_LoadImage(  NULL,
                                    hb_parc(1),
                                    hb_parni(2),
                                    hb_parni(3),
                          (COLORREF)hb_parnl(4),
                      IMAGE_BITMAP, LR_LOADFROMFILE | LR_CREATEDIBSECTION ) );

}

#pragma ENDDUMP


Un saludo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TImageList
Posted: Wed Feb 01, 2006 02:12 PM

Paco,

gracias!

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion