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
testMap
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
testMap
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
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
Re: testMap
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](http://www.pflegeplus.com/pictures/italy.png)
Spain
![Image](http://www.pflegeplus.com/pictures/Spain.png)
France
![Image](http://www.pflegeplus.com/pictures/France.png)
Best Regards
Uwe![Question :?:](./images/smilies/icon_question.gif)
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](http://www.pflegeplus.com/pictures/italy.png)
Spain
![Image](http://www.pflegeplus.com/pictures/Spain.png)
France
![Image](http://www.pflegeplus.com/pictures/France.png)
Best Regards
Uwe
![Question :?:](./images/smilies/icon_question.gif)
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: testMap
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 ?
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
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
Re: testMap
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](http://www.pflegeplus.com/pictures/positin1.png)
Alphablended < AREA.BMP >
![Image](http://www.pflegeplus.com/pictures/area.bmp)
![Image](http://www.pflegeplus.com/pictures/area1.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![Question :?:](./images/smilies/icon_question.gif)
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](http://www.pflegeplus.com/pictures/positin1.png)
Alphablended < AREA.BMP >
![Image](http://www.pflegeplus.com/pictures/area.bmp)
![Image](http://www.pflegeplus.com/pictures/area1.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
![Question :?:](./images/smilies/icon_question.gif)
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: testMap
Uwe,
Look this please :
![Image](http://img849.imageshack.us/img849/770/azzn.jpg)
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
Look this please :
![Image](http://img849.imageshack.us/img849/770/azzn.jpg)
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
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
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: testMap
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](http://img824.imageshack.us/img824/6138/notree.jpg)
Second with Tree on Xbowse and it not draw any zone into map
![Image](http://img545.imageshack.us/img545/8756/treebq.jpg)
If YOU Why ?
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](http://img824.imageshack.us/img824/6138/notree.jpg)
Second with Tree on Xbowse and it not draw any zone into map
![Image](http://img545.imageshack.us/img545/8756/treebq.jpg)
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
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
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: testMap
Please see the solution here
viewtopic.php?f=3&t=25910&p=142190#p142190
viewtopic.php?f=3&t=25910&p=142190#p142190
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India