FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour to nages : fix to Tbitmap paint
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
to nages : fix to Tbitmap paint
Posted: Wed Mar 11, 2015 09:35 AM
in tbitmap -> method paint ...
in lines 677 +- and 696 +-

Code (fw): Select all Collapse
......
if SetAlpha() .and. ::lHasAlpha
            hBitmap := ResizeBmp( ::hBitmap, ::Super:nWidth(), ::Super:nHeight() )
            ABPaint( ::hDC, ::nX, ::nY, hBitmap, ::nAlphaLevel() )
            if hBitmap != nil                // new 
               DeleteObject( hBitmap ) // new
            endif                                // new 
         else
            if ! ::lTransparent
.............
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: to nages : fix to Tbitmap paint
Posted: Wed Mar 11, 2015 12:45 PM

Thanks for pointing out.

I propose to destroy hbitmap if not nil, towards the end of paint method, because this creation by resize is at two places in the paint method. Hope you too will agree.

Also I am considering replacing resizebmp with resizeimg because I found the later function produces a better quality resizing. You may test it too on different bitmaps of different sizes.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: to nages : fix to Tbitmap paint
Posted: Wed Mar 11, 2015 02:42 PM

Nages , resize images from gdi+ is better ... :D ... look code in tgdiplus.prg.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: to nages : fix to Tbitmap paint
Posted: Wed Mar 11, 2015 03:13 PM
mastintin wrote:Nages , resize images from gdi+ is better ... :-) ... look code in tgdiplus.prg.

We need to do a lot more work on GDI. We both will make some time for it.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: to nages : fix to Tbitmap paint
Posted: Wed Mar 11, 2015 04:01 PM
nageswaragunupudi wrote:We need to do a lot more work on GDI. We both will make some time for it.


check your email. I sent a small code for tests.

Continue the discussion