FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Imagelist : Icon and Bitmap from Resource
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM

Imagelist : Icon and Bitmap from Resource

Posted: Sat Feb 11, 2023 05:06 AM
hi,

to load Resource into Imagelist i use
Code (fw): Select all Collapse
   iIcon := LoadIcon( GetResources(), "ICOUP" )
   iIcon := LoadIcon( GetResources(), "ICODOWN" )

   iImage := ILADDICON( ::oImageLHeader:hImageList, iIcon )
and
Code (fw): Select all Collapse
   iIcon := LoadBitmap( GetResources(), "GRID_ASC" )
   iIcon := LoadBitmap( GetResources(), "GRID_DSC" )

   iImage := ILADD( ::oImageLHeader:hImageList, iIcon )
it work with Icon but fail(?) on Bitmap that Way :(

---

when use "File"-Icon i use
Code (fw): Select all Collapse
   iTemp_0 := Icon_Read( ::cPath + cFile, 32 )
   ILADDICON( ::oImageListSmall:hImageList, iTemp_0 )
and
Code (fw): Select all Collapse
   aBitmaps := ::oWnd:ReadImage( ::cPath + cFile, { ::nIcoSmall + 8, ::nIcoSmall + 8 } )
   iTemp_0 := aBitmaps[ 1 ]
   ILADD( ::oImageListSmall:hImageList, iTemp_0 )
here both work

what can be the Problem that Bitmap from Resource seems not to work :?:
it there another Way to load Bitmap Resource into Imagelist :?:
greeting,

Jimmy
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Re: Imagelist : Icon and Bitmap from Resource

Posted: Sat Feb 11, 2023 10:14 AM

There is such a file \source\function\Imgtxtio.prg

In it the function FW_ReadImage() - look at it

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM

Re: Imagelist : Icon and Bitmap from Resource

Posted: Sun Feb 12, 2023 05:31 AM
hi,

do you mean that i can use FW_ReadImage() also for Resource :?:

if yes, how is the Syntax to get Bitmap from Resource :?:
greeting,

Jimmy
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Re: Imagelist : Icon and Bitmap from Resource

Posted: Sun Feb 12, 2023 08:07 AM

FW_ReadImage(nil, "aaa")

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM

Re: Imagelist : Icon and Bitmap from Resource

Posted: Sun Feb 12, 2023 02:22 PM
hi,
Natter wrote:FW_ReadImage(nil, "aaa")
thx for Answer

i have try it and same Result :(
it must be something else in my CODE

CODE come from HMG where i have to change some HB_FUNC() for FiveWin
it have to do with Imagelist where Fivewin have a CLASS while HMG use it "in" HB_FUNC()

---

under HMG it work with Bitmap and i have spend a lot of Time under Fivewin before had Idea to use Icon :roll:
as i use Fivewin Imagelist also for File-Icon and Bitmap i know CLASS TImagelist() does work with Bitmap in Grid

but it fail in Grid-Header where i use up/down Arrow to show how it is "sort"

i need to look deeper why HB_FUNC for Fivewin does only work with Icon and not with Bitmap in Grid-Header
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM

Re: Imagelist : Icon and Bitmap from Resource

Posted: Tue Feb 14, 2023 04:20 AM
hi,

found out what is going on with TImagelist()
Code (fw): Select all Collapse
Method AddIcon( oIcon )
   if ValType( oIcon ) == "C"
      ...
   else
      oIco = oIcon
   endif
so both Object or String can be used
Code (fw): Select all Collapse
METHOD Add( oBmpImage, oBmpMask )
want to have a Object so LoadBitmap() or ReadImage() fail as they return hBITMAP Handle

so i made this
Code (fw): Select all Collapse
   DEFINE BITMAP oBMP RESNAME "GRID_ASC"
   iImage := ::oImageLHeader:Add( oBMP )
   DeleteObject( oBMP )
now i got Bitmap in Grid-Header :D

... but Icon look better ... Transparency of Bitmap is not working ...
greeting,

Jimmy

Continue the discussion