FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Imagem em BTNBMP
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Imagem em BTNBMP
Posted: Fri Feb 28, 2020 08:31 PM
com a versao fwh1912 acontece isto:

com a versao fwh1903 funciona normal
FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Fri Feb 28, 2020 11:57 PM

Can you give the source code for creating of this BTNBMP?

Regards



G. N. Rao.

Hyderabad, India
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 12:27 PM
Code (fw): Select all Collapse
tbtnbig.prg
#include "FiveWin.ch"
function Main()
 local oDlg
   DEFINE DIALOG oDlg FROM 4, 4 TO 10, 28 TITLE "test"
   @ 1, 1 BTNBMP OF oDlg SIZE 40, 13 PIXEL 2007 NOBORDER PROMPT "Imprimir" LEFT RESOURCE "BMP_PRIN" ACTION (alert("teste"), oDlg:End())    // size 40  bmpBIG(fhw1912)  # (fhw1903 OK)
   @ 20, 1 BTNBMP OF oDlg SIZE 42, 13 PIXEL 2007 NOBORDER PROMPT "Imprimir" LEFT RESOURCE "BMP_PRIN" ACTION (alert("teste"), oDlg:End())  // size 42 OK
  ACTIVATE DIALOG oDlg CENTERED
return nil
tbtnbig.rc
BMP_PRIN BITMAP "prin.bmp"



rename prin.bmp
FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 12:46 PM

Thanks. We will look into this now.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 01:23 PM
Tried with this program:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg FROM 4, 4 TO 10, 28 TITLE FWVERSION

   @  1, 1 BTNBMP OF oDlg SIZE 40, 13 PIXEL 2007 NOBORDER PROMPT "Imprimir" LEFT RESOURCE "BMP_PRIN" ACTION (alert("teste"), oDlg:End())    // size 40  bmpBIG(fhw1912)  # (fhw1903 OK)
   @ 20, 1 BTNBMP OF oDlg SIZE 42, 13 PIXEL 2007 NOBORDER PROMPT "Imprimir" LEFT RESOURCE "BMP_PRIN" ACTION (alert("teste"), oDlg:End())  // size 42 OK

  ACTIVATE DIALOG oDlg CENTERED

return nil


rc file
Code (fw): Select all Collapse
BMP_PRIN  BITMAP "c:\fwh\bitmaps\print3.bmp"


result:


We are not able to reproduce the problem with this sample.
Can you please modify the test program or rc file suitable to help us to reproduce the problem and solve the issue.
Regards



G. N. Rao.

Hyderabad, India
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 01:45 PM
nageswaragunupudi
<= use this file... rename to prin.bmp with paint... save as BMP
FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 01:54 PM

Instead, can you please send me the actual bmp file to me?

nageswaragunupudi <at> gmail <dot> com

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 02:04 PM

Yes, I am able to reproduce the problem.
We will study and come back to you.

Regards



G. N. Rao.

Hyderabad, India
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 02:10 PM
ok, thank you
BMP_PRIN BITMAP "E:\fwh1912\bitmaps\16dbgbrk.bmp"
FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 04:29 PM

The problem is narrowed down to be between 1903 and 1906.
We are looking into.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Imagem em BTNBMP
Posted: Sun Mar 01, 2020 06:11 PM
Thanks for pointing out this bug. Fixed for the next release.

For versions FWH1906, FWH1912 and FWH2002 we request the users to apply this fix to the btnbmp.prg:

Please locate these lines in the method PaintBitmap()
Code (fw): Select all Collapse
   if Len( aBmpRect ) > 4
      uResize  := aBmpRect[ 5 ]
   endif
   aBmpRect    := oBtnRect:Modify( aBmpRect ):aRect

You will find these lines at line No.1635 in FWH2002 and FWH1912 and at line No.1624 in FWH1906.

Please insert this line of code:
Code (fw): Select all Collapse
   AEval( aBmpRect, { |n,i| If( n != nil .and. n < 1.0, aBmpRect[ i ] := ROUND( n, 0 ), nil ) } )

in between "endif" and "aBmpRect := ..."

After insertion, the revised code should look like this:
Code (fw): Select all Collapse
   if Len( aBmpRect ) > 4
      uResize  := aBmpRect[ 5 ]
   endif
   AEval( aBmpRect, { |n,i| If( n != nil .and. n < 1.0, aBmpRect[ i ] := ROUND( n, 0 ), nil ) } )
   aBmpRect    := oBtnRect:Modify( aBmpRect ):aRect


Regret the inconvenience.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion