bitmaps trasparents

User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

bitmaps trasparents

Post by MdaSolution »

I must put a bitmap no alpha near to another ...with design clausole on white background

sample :

@ nRow, nCol BITMAP oBJ;
RESOURCE cBitmap;
PIXEL NOBORDER of oDlg TRANSPARENT

oBj:lTransparent = .T.

oBj:HideDots()

oSprite:lDrag := .T.

the problem is the bmp is not transparent and when I put the bmp near to another the second bmp erase the first

I saw the game.prg and there the bmp is trransparent why ?
FWH .. BC582.. xharbour
User avatar
anserkk
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India
Has thanked: 2 times

Re: bitmaps trasparents

Post by anserkk »

MdaSolution,

when I put the bmp near to another the second bmp erase the first


Check the size of the BITMAP CONTROL/BITMAP. Remove the clause NOBORDER so that you will understand how the BMP is displayed by the control. Once you fix the problem you can use the NOBORDER clause

Regards
Anser
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: bitmaps trasparents

Post by Daniel Garcia-Gil »

Hello Mda


please check this post http://forums.fivetechsupport.com/viewtopic.php?p=95372#p95372

the transparences come from brush parent not from image background or over other image
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

Daniel,
I trying that sample your test but
it is wrong because when you move an object it not erase the background
Do you Know roomaranger application ? http://www.roomarranger.com/

the sample game.prg of fwh make the ball transparent
FWH .. BC582.. xharbour
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: bitmaps trasparents

Post by ukoenig »

BMP-Replace in Tile-Style ( maybe some Informations to help ) :

Image

A given BMP replaced with others in Tile-Style :

Code: Select all | Expand


// The Resource :

REDEFINE BITMAP oBMP4  ID 340  ADJUST  RESOURCE "Blanc"  OF oDlg // any Resource will be replaced with new BMP
oBMP4:bPainted := {|hDC| DRAW_BTILE( oBMP4, hDC, oTextfont, c_path + "\images\USER.BMP", ;
"Text-Test", 0, 16777215 ) }

// ---------- Bitmap -TILED with Text if needed on a BMP-resource --------------

FUNCTION DRAW_BTILE( oBitmap, hDC, oTextfont, cBitmap, cTitle, nLeft, nTColor )
LOCAL oImage, nRow := 0, nCol := 0, n

IF FILE( cBitmap )
   DEFINE BITMAP oImage FILENAME cBitmap
   aRect := GETCLIENTRECT( oBitmap:hWnd )
   nHeight := oImage:nHeight
   nWidth := oImage:nWidth
   IF aRect[3] > 0
      DO WHILE nRow < aRect[3]
         nCol = 0
         DO WHILE nCol < aRect[4]
            PalBmpDraw( hDC, nRow, nCol, oImage:hBitmap ) // oBitmap:GETDC()
            nCol += nHeight
         ENDDO
         nRow += nWidth
      ENDDO
   ELSE
      MsgAlert( "Not possible to use Picture " + CRLF + ;
      cBitmap + CRLF + ;
      "for TILED-selection !", "ATTENTION" )
   ENDIF
   // Part : Text define
   // ---------------------
   hOldFont := SelectObject( hDC, oTextFont:hFont )
   nTXTLG :=  GettextWidth( hDC, cTitle )
   nBMPLONG  := oBitmap:Super:nWidth()
   nBMPHIGHT := oBitmap:Super:nHeight()
   nFONTHIGHT := oTextFont:nInpHeight * -1
   IF nLEFT = 0
      nLEFT := (nBMPLONG - nTXTLG) / 2  
   ENDIF
   nNEWHIGHT := nFONTHIGHT
   nTOP := (nBMPHIGHT - nNEWHIGHT) / 2
   SetTextColor( hDC,nTColor)
   SetBkMode( oBitmap:hDC, 0 )
   TextOut( hDC, nTOP, nLEFT, cTitle )
   oBitmap:ReleaseDC()
ELSE
   IF !EMPTY(cBitmap)
      MsgAlert( "File : " + cBitmap + CRLF + ;
      "does not exist" + CRLF + ;
      "to create Background !", "ATTENTION" )
   ENDIF
ENDIF

RETURN( NIL )
 


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: bitmaps trasparents

Post by Daniel Garcia-Gil »

MdaSolution wrote:Daniel,
I trying that sample your test but
it is wrong because when you move an object it not erase the background
Do you Know roomaranger application ? http://www.roomarranger.com/

the sample game.prg of fwh make the ball transparent


Daniel Garcia-Gil wrote:the transparences come from brush parent not from image background or over other image

game.prg use BRUSH

Code: Select all | Expand

   DEFINE BRUSH oBrush;
           FILE "..\bitmaps\backgrnd\beach.bmp"


if you want bitmap transparent over other image ( no over brush ) you should seek in internet about transparency technique and use the bitmap handled for do that
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

sorry I not search to internet to see if I can make it ...

My question was ....

can make it with fwh ? yes or no ?

I think It can be done with fwh because I saw an application made with fwh of Apolo software : it create floor plan and use bitmap to create it

each bmps is tranparent and can be put near to another as you can see here :

Image
FWH .. BC582.. xharbour
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: bitmaps trasparents

Post by Daniel Garcia-Gil »

Mda

yes i thinks you can.... but not with traditional class

maybe you need make you own function to paint sprite, from C level or PRG level
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

Daniel,

Perhaps I found a solution

If I use Superbutton I can insert a bitmap near to another

I try with sbutton Release 7.0 But I think there is a problem because when I use design clause it draw the rectangule of checkdots bad

look it please :

Image

I use then an action to refresh the dialog ( and the bitmaps I drawing ) but it refresh also the ribbon and it make a flash on the dialog
FWH .. BC582.. xharbour
User avatar
mmercado
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: bitmaps trasparents

Post by mmercado »

Hi MDA:
MdaSolution wrote:I try with sbutton Release 7.0 But I think there is a problem because when I use design clause it draw the rectangule of checkdots bad

I use then an action to refresh the dialog ( and the bitmaps I drawing ) but it refresh also the ribbon and it make a flash on the dialog

I'll try to help, just send me a self contained sample program where I can reproduce that situation.

Best regards.

Manuel Mercado Gómez.
manuelmercado at prodigy dot net dot mx
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

Manuel,
I sent you a message with test sample where you can see the error
FWH .. BC582.. xharbour
User avatar
mmercado
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: bitmaps trasparents

Post by mmercado »

Hi mda:
MdaSolution wrote:I sent you a message with test sample where you can see the error

Got nothing, please resend it.

Best Regards.

Manuel Mercado Gómez.
manuelmercado at prodigy dot net dot mx
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

I resent it this morning
FWH .. BC582.. xharbour
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: bitmaps trasparents

Post by ukoenig »

Is there something wrong with my Solution ??
( no problem, to add Wall-parts as well )

Image

You can rearange everything.

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Fri May 07, 2010 9:24 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Post by MdaSolution »

Where is the source CAn I try this ?

Then
the error is when you move a button with mouse with design value look my snapshot please
FWH .. BC582.. xharbour
Post Reply