to nages : fix to Tbitmap paint

to nages : fix to Tbitmap paint

Postby mastintin » Wed Mar 11, 2015 9:35 am

in tbitmap -> method paint ...
in lines 677 +- and 696 +-

Code: Select all  Expand view  RUN


......
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
.............

 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: to nages : fix to Tbitmap paint

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: to nages : fix to Tbitmap paint

Postby mastintin » Wed Mar 11, 2015 2:42 pm

Nages , resize images from gdi+ is better ... :D ... look code in tgdiplus.prg.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: to nages : fix to Tbitmap paint

Postby nageswaragunupudi » Wed Mar 11, 2015 3:13 pm

mastintin wrote:Nages , resize images from gdi+ is better ... :D ... 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
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: to nages : fix to Tbitmap paint

Postby mastintin » Wed Mar 11, 2015 4: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.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests