Natter wrote:Here is the map.bmp file:
https://dropmefiles.com.ua/ru/QwWY- Code: Select all Expand view RUN
#include "FiveWin.ch"
procedure Main
local siz:={575,659}
private oFrg
DEFINE DIALOG oFrg FROM 0,0 TO siz[1], siz[2] PIXEL ;
STYLE nOR(WS_POPUP, WS_BORDER)
ACTIVATE DIALOG oFrg ON INIT Frg_Ini()
return
procedure Frg_Ini
local oCl
* @ 0,0 BITMAP oCl OF oFrg SIZE oFrg:nWidth, oFrg:nHeight PIXEL NOBORDER
oCl:=TXImage():New(0, 0, oFrg:nWidth, oFrg:nHeight,, oFrg,, .F.)
* oCl:bPainted:={|hDc| FloodFill(hDc, 0, 0, CLR_BLACK, CLR_WHITE)}
oCl:SetSource("map.bmp")
oFrg:Center()
return
This entire code can be written as:
- Code: Select all Expand view RUN
DEFINE DIALOG oDlg SIZE 575,569 PIXEL TRUEPIXEL
@ 0,0 XIMAGE oImg FILE ".\Natter\map.bmp" SIZE 0,0 OF oDlg NOBORDER
ACTIVATE DIALOG oDlg CENTERED
with the same functionality.
As you said, you will see the border line in CLR_WHITE. That is because the background color of XImage control is CLR_WHITE.
Now add one line of code:
- Code: Select all Expand view RUN
DEFINE DIALOG oDlg SIZE 575,569 PIXEL TRUEPIXEL
@ 0,0 XIMAGE oImg FILE ".\Natter\map.bmp" SIZE 0,0 OF oDlg NOBORDER
oImg:SetColor( CLR_GRAY, CLR_HRED ) // Added
ACTIVATE DIALOG oDlg CENTERED
Now you will see the border of the polygon in CLR_HRED.
You can test changing the background color in oImg:SetColor() and see that the border is shown in the background color of the control.
Now, this takes us back to drawing the polygon using Line() method in the first place.
The 4th and last param of FW_MakeYourBitmap() is lAlpha. Did you set this to .T. ?
Please wait for my next posting