bitmaps trasparents

bitmaps trasparents

Postby MdaSolution » Fri Apr 30, 2010 12:10 pm

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
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby anserkk » Fri Apr 30, 2010 12:15 pm

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
anserkk
 
Posts: 1329
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: bitmaps trasparents

Postby Daniel Garcia-Gil » Fri Apr 30, 2010 12:21 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: bitmaps trasparents

Postby MdaSolution » Fri Apr 30, 2010 12:45 pm

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
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby ukoenig » Fri Apr 30, 2010 12:55 pm

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

Image

A given BMP replaced with others in Tile-Style :
Code: Select all  Expand view

// 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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: bitmaps trasparents

Postby Daniel Garcia-Gil » Fri Apr 30, 2010 1:19 pm

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 view
   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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: bitmaps trasparents

Postby MdaSolution » Fri Apr 30, 2010 3:47 pm

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
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby Daniel Garcia-Gil » Fri Apr 30, 2010 4:07 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: bitmaps trasparents

Postby MdaSolution » Mon May 03, 2010 3:31 pm

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
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby mmercado » Mon May 03, 2010 11:42 pm

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
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: bitmaps trasparents

Postby MdaSolution » Thu May 06, 2010 7:25 am

Manuel,
I sent you a message with test sample where you can see the error
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby mmercado » Fri May 07, 2010 12:52 am

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
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: bitmaps trasparents

Postby MdaSolution » Fri May 07, 2010 11:41 am

I resent it this morning
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby ukoenig » Fri May 07, 2010 3:25 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: bitmaps trasparents

Postby MdaSolution » Fri May 07, 2010 4:03 pm

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
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests