FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour testMap
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
testMap
Posted: Tue Mar 26, 2013 06:58 PM

I saw the sample of TestMap

I wish Fill with a color a part of a bitmap sample : on Red a state of Europe

  1. How I can colorize this zone ?
  2. How I can save the x,y to savethem on dbf and make the fill when I click on this record
    sample

Espana x,y ->>>> RED floodfill on bitmap
Italy x,y -----> BLue
Germany x,y ----> Yellow

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: testMap
Posted: Tue Mar 26, 2013 08:11 PM
Silvio,

I think filling a unsymmetrical area is not possible.

What you an do is :

1. You need a empty WHITE map with black border-lines
2. fill the selected area with a color
3. save the image with the country-name

How to create the different images :

1. load the blanc image with PIXELFORMER
2. select a color
3. use the FILL-tool to fill a selected area
The Fill-tool detects the painted country-borders ( black lines )

Save the different BMP's to Your DBF-file
At runtime, You can change the image.


Italy


Spain


France


Best Regards
Uwe :-)
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.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: testMap
Posted: Tue Mar 26, 2013 09:06 PM

Uwe,

I have an old app made with fw + clipper 16 bit and I wish converte it on 32 bit

I converte it and not run ok

I have a Map of Italy

I have a dbf with coordinates x,y

then I have a xbrowse and made

oBrw:bChange:= {|| Disegna_cartina(oTree,oDlg,oCartina,oBrw) }

....

static Function Disegna_cartina(oTree,oDlg,oCartina,oBrw)
Local nRow,nCol
Local oldRec:= Provve->(Recno())
Local Hdc := oDlg:GetDc()
Local nLivello:= oBrw:oTreeItem:nLevel

IF nLivello = 3
nRow := provve->posx
nCol := provve->posy

oCartina:bPainted = { |hDC| FLOODFILL( hDC,nRow,nCol,12632256) }

Else
Endif
oDlg:UPDATE()
oDlg:refresh()

DeleteDC( hDC )
oDlg:ReleaseDC()
Return nil

But it put the color to everything on bitmap and not run ok perhaps the function FLOODFILL was changed ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: testMap
Posted: Tue Mar 26, 2013 11:17 PM
Silvio,

I would place a transparent BTNBMP without text on the needed position
that works fine and looks nicer.
From the browser You can call the button to be displayed.
Save button-top / left to Your DBF
Maybe also add fields for the Buttonsize to Your DBF.
As a extra You will have a action and Tooltip
Add ADJUST for different sizes in Button 1



Alphablended < AREA.BMP >





@ 150, 150 BTNBMP oBtn1 OF oWnd PIXEL ;
SIZE 48, 48 ;
FILE c_path1 + "area.bmp" ;
ACTION MsgInfo("Hello")
oBtn1:lTransparent := .T.
oBtn1:cTooltip := { "Show" + CRLF + ;
"the selected area","Area", 1, CLR_BLACK, 14089979 }

@ 250, 350 BTNBMP oBtn2 OF oWnd PIXEL ;
SIZE 55, 55 ;
ACTION MsgInfo("Hello")
oBtn2:SetColor( 0, 255 )
oBtn2:cTooltip := { "Show" + CRLF + ;
"the selected area","Area", 1, CLR_BLACK, 14089979 }

@ 250, 450 BTNBMP oBtn3 OF oWnd PIXEL ;
SIZE 64, 64 BORDER ADJUST ;
FILE c_path1 + "area1.bmp" ;
ACTION MsgInfo("Hello")
oBtn3:lTransparent := .T.
oBtn3:cTooltip := { "Show" + CRLF + ;
"the selected area","Area", 1, CLR_BLACK, 14089979 }

Best Regards
Uwe :-)
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.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: testMap
Posted: Wed Mar 27, 2013 10:54 AM
Uwe,
Look this please :



the problem I have allready small application on 16 bit oldest fw+clipper with a database

on this database there are fields with posx and posy for to draw with the function floodfill a zone of a map made witha Bitmap ( Italy)

the problem now is when I recompile this small Appp not run correctly and when I select a Region on database it must draw the zone

sample Sicily -> flood fill the sicily on the map

The coordinates cannot be wrong because on fw16 clipper app run ok

It not draw correctly

_ or thereis an error if the floodfill is changed

_or thereis an error when I use source code to make the dialog and controls ( on original app I used resources)

Now I try to found the coordinates on Bitmap

with this command :

oCartina:bLClicked = { | nRow, nCol, nFlags | NMSGBOX(nRow, nCol) }

But I have many problems to understand wich are the real coordinate of region to draw

because the command not return the coordinates or I make an error
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: testMap
Posted: Wed Mar 27, 2013 09:18 PM
I found the problem is on Xbrowse Tree

because I made two test

First with NO TREE and on xbrowse and I can draw all regions of the Map as you can see here





Second with Tree on Xbowse and it not draw any zone into map



If YOU Why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: testMap
Posted: Thu Mar 28, 2013 04:41 PM

Please see the solution here

viewtopic.php?f=3t=25910p=142190#p142190

&&

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion