Imagem em BTNBMP

Post Reply
User avatar
Sistem
Posts: 224
Joined: Sun May 13, 2012 7:52 am

Imagem em BTNBMP

Post by Sistem »

com a versao fwh1912 acontece isto:
Image
com a versao fwh1903 funciona normal
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
Sistem
Posts: 224
Joined: Sun May 13, 2012 7:52 am

Re: Imagem em BTNBMP

Post 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
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

Post by nageswaragunupudi »

Thanks. We will look into this now.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

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

G. N. Rao.
Hyderabad, India
User avatar
Sistem
Posts: 224
Joined: Sun May 13, 2012 7:52 am

Re: Imagem em BTNBMP

Post by Sistem »

nageswaragunupudi
Image <= use this file... rename to prin.bmp with paint... save as BMP
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

Post by nageswaragunupudi »

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

nageswaragunupudi <at> gmail <dot> com
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
Sistem
Posts: 224
Joined: Sun May 13, 2012 7:52 am

Re: Imagem em BTNBMP

Post by Sistem »

ok, thank you
BMP_PRIN BITMAP "E:\fwh1912\bitmaps\16dbgbrk.bmp"
Image
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Imagem em BTNBMP

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

G. N. Rao.
Hyderabad, India
Post Reply