Bitmap size of dcmenuitem

This forum is for eXpress++ general support.
Post Reply
Message
Author
Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Bitmap size of dcmenuitem

#1 Post by Wolfgang Ciriack »

Hello Roger,
is there a possibility to set the size of the bitmap from a DCMENUITEM if the bitmap resource is an icon ?
You see in this picture, that they are loaded in a to big size.
Attachments
test4.jpg
test4.jpg (35.51 KiB) Viewed 5762 times
_______________________
Best Regards
Wolfgang

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Bitmap size of dcmenuitem

#2 Post by Auge_Ohr »

Menue Bitmap must be 16x16.
look into Source of DCMENUITEM -> c:\exp19\Source\Dclipx\_dcclass.prg

Code: Select all

  oBmp := ::ItemImages[aInfo[1]]

   IF oBmp != NIL .AND. ::bitmaps
      nY := ((aInfo[4][4] - 1 - aInfo[4][2]) - oBmp:ySize) /2
      IF oBmp:isDerivedFrom('XbpIcon')
        nY += aInfo[4][2]+3
        x := aInfo[4][1] + ::BarWidth + ITEM_SPACING *2
        y := nY
        oBmp:draw( oPS, { x, y, x + 22, y + 22 } )
      ELSE
        nY += aInfo[4][2]
        oBmp:draw( oPS, {aInfo[4][1] + ::BarWidth + ITEM_SPACING *2,nY} )
      ENDIF
   ENDIF
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Bitmap size of dcmenuitem

#3 Post by rdonnay »

Try this:

oIcon := XbpIcon():new():create()
oIcon:loadFile('myicon.ico',16,16)

DCMENUITEM 'My Menu Item' ICONS {oIcon}
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Bitmap size of dcmenuitem

#4 Post by Wolfgang Ciriack »

Thanks, i will try that.
_______________________
Best Regards
Wolfgang

Post Reply