testMap

testMap

Postby Silvio.Falconi » Tue Mar 26, 2013 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: testMap

Postby ukoenig » Tue Mar 26, 2013 8: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
Image

Spain
Image

France
Image

Best Regards
Uwe :?:
Last edited by ukoenig on Tue Mar 26, 2013 11:16 pm, edited 4 times 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: testMap

Postby Silvio.Falconi » Tue Mar 26, 2013 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: testMap

Postby ukoenig » 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

Image

Alphablended < AREA.BMP >

Image

Image

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

Re: testMap

Postby Silvio.Falconi » Wed Mar 27, 2013 10:54 am

Uwe,
Look this please :

Image

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: testMap

Postby Silvio.Falconi » Wed Mar 27, 2013 9: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

Image



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

Image

If YOU Why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: testMap

Postby nageswaragunupudi » Thu Mar 28, 2013 4:41 pm

Please see the solution here
viewtopic.php?f=3&t=25910&p=142190#p142190
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Marc Vanzegbroeck and 34 guests