Page 1 of 1
how to use a Bitmap "Band" with harbour / HMG
Posted: Sun Nov 24, 2019 11:55 pm
by AUGE_OHR
hi,
i have some Bitmap like this

- Digits2Blu.jpg (7.47 KiB) Viewed 1599 times
picture here is *JPG while *.BMP is not allowed as upload
it contain "more" than one Bitmap so you have to split it to use.
i have search for HB_FUNC with "BitBlt" API Function but nothing seems to match.
who have a Tip

Re: how to use a Bitmap "Band" with harbour / HMG
Posted: Mon Nov 25, 2019 8:33 am
by AUGE_OHR
hi,
i have found StretchBlt function
https://docs.microsoft.com/de-de/window ... stretchblt
Code: Select all
HB_FUNC(STRETCHBLT)
{
hb_retl( StretchBlt( (HDC) hb_parnl( 1 ) ,
hb_parni( 2 ) ,
hb_parni( 3 ) ,
hb_parni( 4 ) ,
hb_parni( 5 ) ,
(HDC) hb_parnl( 6 ) ,
hb_parni( 7 ) ,
hb_parni( 8 ) ,
hb_parni( 9 ) ,
hb_parni( 10 ) ,
(DWORD) hb_parnl( 11 )
) );
}
it seems better API function while it contain Source and Target.
now i have to find out how to use it which harbour / HMG as it need 2 x HDC
Re: how to use a Bitmap "Band" with harbour / HMG
Posted: Tue Nov 26, 2019 7:44 am
by AUGE_OHR
Re: how to use a Bitmap "Band" with harbour / HMG
Posted: Thu Nov 28, 2019 12:16 am
by AUGE_OHR
hi,
now i try it with LABEL and IMAGE but even if i got the Controlhandle it does not show anything
i have enable in BMP_PAINT
both are WC_STATIC and i know it it possible to BitBlt() or StretchBlt() into those hDC
as HMG has LABEL and IMAGE (for me both are the same -> WC_STATIC) i have to ask for Limitation.
the Difference is "only" Style of LABEL and IMAGE and that can be change "on-fly"
Code: Select all
nStyle := @user32:GetWindowLongA(hWnd, GWL_STYLE) // get Style
nStyle := nAndNot(nStyle, WS_VSCROLL, LBS_DISABLENOSCROLL) // remove some Style
nStyle := nor(nStyle, LBS_DISABLENOSCROLL ) // add Style
@user32:SetWindowLongA(hWnd , GWL_STYLE , nStyle ) // set Style
@user32:InvalidateRect(hWnd,1)
Question : can i still change Style (if i want) or does it make Problem e.g. with _HMG_SYSDATA
Re: how to use a Bitmap "Band" with harbour / HMG
Posted: Thu Nov 28, 2019 2:49 am
by andyglezl
Declare Window BMP_BAND1
Declare Window BMPBAND2
Can't open #include file 'BMP_BAND1.fmg'
No encuentro estos .fmg ?
*-----------------------------------
I can't find these .fmg?
Re: how to use a Bitmap "Band" with harbour / HMG
Posted: Thu Nov 28, 2019 4:12 am
by AUGE_OHR
andyglezl wrote: ↑Thu Nov 28, 2019 2:49 am
Declare Window BMP_BAND1
Declare Window BMPBAND2
Can't open #include file 'BMP_BAND1.fmg'
No encuentro estos .fmg ?
*-----------------------------------
I can't find these .fmg?
Ok, sorry ... total forgot FMG files
here it is
---
i got Part of Solution :
Code: Select all
HB_FUNC(InvalidateRect)
{
HWND hWnd;
RECT rect;
hWnd = (HWND) hb_parnl (1);
GetClientRect(hWnd, &rect);
InvalidateRect(hWnd,&rect,1);
hb_retnl (0);
}
try it before/after BMP_PAINT and you will some Parts ... but it is still not ok