Page 1 of 1

Imagem em BTNBMP

Posted: Fri Feb 28, 2020 8:31 pm
by Sistem
com a versao fwh1912 acontece isto:
Image
com a versao fwh1903 funciona normal

Re: Imagem em BTNBMP

Posted: Fri Feb 28, 2020 11:57 pm
by nageswaragunupudi
Can you give the source code for creating of this BTNBMP?

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 12:27 pm
by Sistem

Code: Select all

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"
 
Image

Image rename prin.bmp

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 12:46 pm
by nageswaragunupudi
Thanks. We will look into this now.

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 1:23 pm
by nageswaragunupudi
Tried with this program:

Code: Select all

#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: Select all

BMP_PRIN  BITMAP "c:\fwh\bitmaps\print3.bmp"
result:
Image

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.

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 1:45 pm
by Sistem
nageswaragunupudi
Image <= use this file... rename to prin.bmp with paint... save as BMP

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 1:54 pm
by nageswaragunupudi
Instead, can you please send me the actual bmp file to me?

nageswaragunupudi <at> gmail <dot> com

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 2:04 pm
by nageswaragunupudi
Yes, I am able to reproduce the problem.
We will study and come back to you.

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 2:10 pm
by Sistem
ok, thank you
BMP_PRIN BITMAP "E:\fwh1912\bitmaps\16dbgbrk.bmp"
Image

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 4:29 pm
by nageswaragunupudi
The problem is narrowed down to be between 1903 and 1906.
We are looking into.

Re: Imagem em BTNBMP

Posted: Sun Mar 01, 2020 6:11 pm
by nageswaragunupudi
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: Select all

   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: Select all

   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: Select all

   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.