bitmaps trasparents

Re: bitmaps trasparents

Postby ukoenig » Fri May 07, 2010 4:14 pm

I don't use TSbutton !

At Start, I save all BMP-Values from a DBF to a Array.
After the BMP-settings, I save the Positions back to the DBF.

@ nTOP[I], nLEFT[I] BITMAP oBmp[I] FILENAME "tree.bmp" SIZE 64, 64 PIXEL ADJUST TRANSPARENT NOBORDER
*oBmp[I]:lDesign := .T. // not needed !!!
oBmp[I]:lDrag := .T.

In case You like this Solution, I can put all together in a Download-File.

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 MdaSolution » Fri May 07, 2010 4:48 pm

I MUST SEE THIS YOUR SOLUTION RUN WITH MY PROBLEM
where I can download it ?
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 4:58 pm

Function-test :
Activate / deaktivate a Table with right Mouseclick.

http://www.pflegeplus.com/fw_downloads/draw.zip

Best Regards
Uwe :lol:
Last edited by ukoenig on Fri May 07, 2010 8:13 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 5:20 pm

and the src ?

Sorry, and then there is the same error of trasparent bitmap look the snap
Image
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby MdaSolution » Fri May 07, 2010 5:33 pm

Ukoenig,
if you download the demo of this fwh user at http://www.apolosoftware.com/gst/index.html
you can see at seven folder "ventas" , you must select sala de ventas and then on a record doubleclick and the press f3
you can see the designer where the bitmaps are trasparent if you put a bitmap near to another


Image
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 5:41 pm

I included the Source.

Activate / deaktivate a Table with right Mouseclick.
Download ( everything included ) :
http://www.pflegeplus.com/fw_downloads/draw.zip

Don't forget Daniel's change in Class CONTROL ( Refresh() ) !!!

in CONTROL.PRG, method LButtonUp LOCATE

if Empty( ::nMResize )
::Move( ::nTop + nRow - nMRow, ::nLeft + nCol - nMCol,,, .t. )

ADD AFTER

::Refresh()


You can draw Walls on any Position and Size with :

LOCAL aGrad1 := { { 0.1, 16437160, 16777215 }, ;
{ 0.1, 16777215, 16437160 } }
For plain Color use the same for 1. and 2. Color

ACTIVATE WINDOW oWnd ;
ON PAINT ( GradientFill( hDC, 0, 650, oWnd:nHeight, oWnd:nWidth - 320, aGrad1, .T. ), ; // Vertical Line
...
...
Image

It is a quick Solution and I think it is possible, to make it still smaller.
Bitmap on Bitmap doesn't show for Transparent-parts the Surface of the 1. covered BMP.
Transparent uses the defined Background-Brush.

I don't know, if it is possible to use the covered part of the 1. BMP as Brush.
Do You need it ?
I think placing a Table on top of another doesn't happen
but possible to place it near a Tree, like shown in Your example.
Maybe I can find a Solution for this Problem.

I think a better Solution for a Table/Tree Position ( Your Example ) would be,
to replace a Tree with a new symbol, because You also want to show if a Table is free or not.
The Tree-space in the Archive could be used for the new Symbols.
The Trees could be placed directly on the plan and adjusted there. The same with the Bar.

Image

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 MdaSolution » Sat May 08, 2010 7:30 am

thanks for delay..
do you try the Apolosoftware application
if you have a bitmap ove to another and move the mouse from one to the other bitmap you can see the app refresh the bitmap where you moved the mouse and all are transparent and not use a background bitmap as you
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby Bayron » Sat May 08, 2010 10:14 am

Uwe,

Woooooow...

very nice work...

this sample is a complete work by it self....

Thanks for the source code!!!

Is there a a way to give the tables limit boundaries to where they can be moved?

Right now they can be placed on top of the blue area and even on top of the buttons...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: bitmaps trasparents

Postby Bayron » Sat May 08, 2010 9:59 pm

Uwe,

I noticed the same behavior that mdasolution is talking about...

At the moment of moving any giving bitmap, the background also moves with it...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: bitmaps trasparents

Postby ukoenig » Sat May 08, 2010 11:31 pm

Bayron,

I did some Tests / changes with FWH/samples/BMPonBMP.prg
It seems using the logic, it is possible to place a BMP on top or next of each other.
It is not a Alphablended BMP !!!

Image

Image

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 Bayron » Sun May 09, 2010 2:14 am

Uwe,

I tried this way too, it's drawn fine, but the problem is still there when the bitmap is moved....

The main problem is that the handle of the bitmap in the bottom has to be selected to draw the bitmap on top, and this way the transparency is kept...

As Daniel Garcia-Gil said, everything is posible with a lot of the right code, but my knoledge does not go that far...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: bitmaps trasparents

Postby MdaSolution » Sun May 09, 2010 2:16 pm

Good Ukoenig,
But perhaps it is that I not wanted and searched.
My problem is another, I must created an application for restaurant
for first step I must create a dialog where I can move each tables and save theris position : can be there was any object near to another as the picture I sad you.
for second step I must set for each tables 6 actions: ( colors or different bitmaps) Free,Occupated,Cash,Attending,Reservation,Stop
I sad also you to download the Apollo Software application to see what it make but I understand You want I create what Daniel sad .
Daniel sad I cannot create it (transparency) with fwh classes but perhaps someone make errors because the apollosoftware made on fwh language.
Sbutton made on his class trasparency I want but have some errors on Seven Release.
I'm sorry but I think must wait when these all errors are corrected.
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby ukoenig » Sun May 09, 2010 5:01 pm

for second step I must set for each tables 6 actions: ( colors or different bitmaps) Free,Occupated,Cash,Attending,Reservation,Stop

Define and change the BMP's from a Popup-menu on right Mouse-click.

Image

Maybe we will find a Solution for the Transparent / Brush - problem.

Code: Select all  Expand view

...
oBmp[1]:bPainted := {|hDC| DRAW_TXT( oBmp[1], hDC, oBtnFont, "1", 0, 128 ) }
oBmp[1]:bRClicked := { || ShowPopUp( oWnd, oBmp[1]:nTop, oBmp[1]:nLeft+64 ), ;
      IIF( nSelect = 1, oBmp[1]:LoadBMP( "Green.bmp" ), NIL ), ;
      IIF( nSelect = 2, oBmp[1]:LoadBMP( "Red.bmp" ), NIL ), oBmp[1]:Refresh() }
...
...
//----------------------------------------------------------------------------//

FUNCTION BuildPopup()
local oMenu

MENU oMenu POPUP                            
      MENUITEM "Free" ACTION nSelect := 1
      MENUITEM "Occupated" ACTION nSelect := 2
      MENUITEM "Cash" ACTION nSelect := 3 MESSAGE "Select whatever..."
      MENUITEM "Attending" ACTION nSelect := 4 MESSAGE "Everything"
      MENUITEM "Reservation" ACTION nSelect := 5
      SEPARATOR
      MENUITEM "Stop" ACTION nSelect := 6
ENDMENU

RETURN oMenu

//----------------------------------------------------------------------------//

FUNCTION ShowPopup( oWnd, nRow, nCol )

oMenu := BuildPopup()

ACTIVATE POPUP oMenu WINDOW oWnd AT nRow, nCol

RETURN NIL
 


Changing to MDI, The MDI-Child will be the Drawingarea.
With STOP, You can replace a Table to the original Position inside the Storage-Area.

Image

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 MdaSolution » Mon May 10, 2010 4:05 pm

you allready modfy the source at download ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: bitmaps trasparents

Postby ukoenig » Mon May 10, 2010 4:39 pm

There are still some small things to do.

I added the Wallpainting and the Piano.
Now it is complete and looks like Your picture.
As soon it is finished, I will put a new Download-Link on this Place.
I think it will be a good Foundation, to work on the Transparent-painting-Problem ( interleaved )

Description :

Defined Dialog-size as Drawing-area.
Move to any Position inside the Dialog.
Reset ( move ) on Buttonclick all Objects to the Storage-area.
Right Mouseclick on a Bitmap opens a Popup-menu.
Menu-Selection 6 < Stop > moves the selected BMP to the Storage-area.
The Popup-selections ( 1-5 ) changes the BMP.
The Button < Save > saves the Positions and BMP-Status (shown Image) to a DBF-File.
At new Start, the BMP's are placed to the selected Positions.
Needed Walls are drawn on Dialog-paint.

Image

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 56 guests