icon-rendering....on Buttonbar

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed I made some tests on Wine to make it work!
Author of Total Commander
https://www.ghisler.com
User avatar
blacky
Senior Member
Senior Member
Posts: 312
Joined: 2003-02-07, 16:58 UTC
Location: was das/whot's dath ?

Post by *blacky »

Hy Christian,

and now u now, it work on reactos 100Percent too ;)

Good work !! i can think me it was not a easy bug to find it out ...

greetings
Blacky :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Nice to hear that! Yes, it was quite time-consuming to find the reason of the problem...
Author of Total Commander
https://www.ghisler.com
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

i have a same problem with another application.

from my understand i need to refresh the display or in the case of TC reload menu bar.

Mr.ghisler or someone can you please tell me how was it solved?
#181344 Personal licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It was a problem with reading the icons from cache. In Tc 7.0 beta 2, I used the following code to load the monochrome (mask) bitmap:

Code: Select all

        iconinfo.hbmMask:=CreateBitmap(pbih.biWidth,
                        pbih.biHeight,
                        pbih.biPlanes,
                        pbih.biBitCount,nil);
        SetDIBits(dc,iconinfo.hbmMask,0, pbih.biHeight,
           pchar(pbmi)+sizeof(tBITMAPINFOHEADER)+ pbih.biClrUsed*sizeof(tRGBQUAD),
           pbmi^, DIB_RGB_COLORS);
In beta 3, this was changed to:

Code: Select all

        //Convert mono bits from dword-alligned bottom-up to word-aligned top-down!
        bytewidth2:=((pbih.biWidth+15) and not 15) div 8;  {word-alligned!}
        monobitsize:=bytewidth2*pbih.biHeight;
        getmem(monobits,monobitsize);
        ptr0:=pchar(pbmi)+sizeof(tBITMAPINFOHEADER)+ pbih.biClrUsed*sizeof(tRGBQUAD);
        for j:=0 to pbih.biHeight-1 do
          move(ptr0[j*bytewidth],monobits[(pbih.biHeight-j-1)*bytewidth2],bytewidth2);
        iconinfo.hbmMask:=CreateBitmap(pbih.biWidth,
                        pbih.biHeight,
                        pbih.biPlanes,
                        pbih.biBitCount,monobits);
        freemem(monobits,monobitsize);
Author of Total Commander
https://www.ghisler.com
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

oky, it involves code changes. i will pass this info to the application developer with similar problems. Thank you sir.
#181344 Personal licence
Post Reply