how to use a Bitmap "Band" with harbour / HMG

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

how to use a Bitmap "Band" with harbour / HMG

Post by AUGE_OHR »

hi,

i have some Bitmap like this
Digits2Blu.jpg
Digits2Blu.jpg (7.47 KiB) Viewed 1501 times
BMP_BAND1.zip
(1.27 KiB) Downloaded 119 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 :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: how to use a Bitmap "Band" with harbour / HMG

Post 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
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: how to use a Bitmap "Band" with harbour / HMG

Post by AUGE_OHR »

have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: how to use a Bitmap "Band" with harbour / HMG

Post 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

Code: Select all

   hDC = GetDC (hWnd)
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 :?:
BMP_BAND2.ZIP
(2.59 KiB) Downloaded 109 times
have fun
Jimmy
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: how to use a Bitmap "Band" with harbour / HMG

Post 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?
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: how to use a Bitmap "Band" with harbour / HMG

Post 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 :roll:

here it is
BMP_FMG.ZIP
(1.22 KiB) Downloaded 102 times
---

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
have fun
Jimmy
Post Reply