There's something different in the size of the bitmaps painted over bitmap buttons. Please check.
EMG
There's something different in the size of the bitmaps painted over bitmap buttons. Please check.
EMG
Enrico,
Here it seems ok. Could you please provide an example or a screenshot ? thanks ![]()
Antonio,
screenshots sent. Let me know if you received them.
EMG
if ! Empty( hBmp )
if ::lBmpTransparent
if SetAlpha() .and. ::aAlpha[ nBtn ]
ABPaint( ::hDC, oBmpRect:nLeft, oBmpRect:nTop, hBmp, ::nAlphaLevel() )
else
DrawTransBmp( ::hDc, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth )
endif
else
PalBmpDraw( ::hDC, oBmpRect:nTop, oBmpRect:nLeft, hBmp, hPal, oBmpRect:nWidth, oBmpRect:nHeight, ;
nil, ::lBmpTransparent )
endif
endifAntonio,
no, unfortunately it is not enough. The image is still not centered and the button still miss the border.
EMG
Enrico,
Just curiosity, have you tried with + 2 ?
It seems to me as those functions are using the coordinates in a different way. We are going to review it, thanks
Antonio Linares wrote:Enrico,
Just curiosity, have you tried with + 2 ?
Antonio Linares wrote:It seems to me as those functions are using the coordinates in a different way. We are going to review it, thanks
if ! Empty( hBmp )
if ::lBmpTransparent
if SetAlpha() .and. ::aAlpha[ nBtn ]
ABPaint( ::hDC, oBmpRect:nLeft, oBmpRect:nTop, hBmp, ::nAlphaLevel() )
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth )
endif
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth )
endif
endifAntonio Linares wrote:Enrico,
Please change it this way and it should work fine:
if ! Empty( hBmp ) if ::lBmpTransparent if SetAlpha() .and. ::aAlpha[ nBtn ] ABPaint( ::hDC, oBmpRect:nLeft, oBmpRect:nTop, hBmp, ::nAlphaLevel() ) else DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth ) endif else DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth ) endif endif
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nWidth )DrawTransBmp( ::hDc, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nWidth )Enrico,
How do you create the TBtnBm control ? is it from resources ?
Please post here the RC section and the REDEFINE ... code, thanks
REDEFINE BTNBMP;
ID 109 OF oDlg;
RESOURCE "BMP1", NIL, "BMP2";
ACTION ...CONTROL "", 109, "TBtnBmp", WS_CHILD | WS_VISIBLE, 207, 125, 10, 13Enrico,
Could you provide an example without RCs ? thanks
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg;
SIZE 800, 600
@ 10, 10 BTNBMP SIZE 20, 20;
FILE "c:\fwh\bitmaps\open.bmp";
ADJUST
ACTIVATE DIALOG oDlg;
CENTER
RETURN NILAntonio,
yes, now the bitmaps are centered again, great! Please note that there are more than one place to fix.
Now, how to get the border back? ![]()
EMG