L
lee_xl
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么如下方法不能改变图元的颜色?
procedure TMapForm.Button6Click(Sender: TObject);
var
obj:CMapXStyle;
FoundFeature: FindFeature;
lyr:CMapXLayer;
begin
Map1.Layers.item('USA').editable:=true;
Map1.Layers.item('USA').begin
Access(1);
lyr:= Map1.Layers.item('USA');
FoundFeature := Map1.Layers.Item('USA').Find.Search('OK', EmptyParam);
if FoundFeature.FindRC mod 10 = 1 then
begin
obj:=FoundFeature.Style
obj.RegionPattern:=2;
obj.RegionColor:=miColorRed;
FoundFeature.Style:=obj;
lyr.Refresh;
end;
Map1.Layers.item('USA').EndAccess(0);
end;
procedure TMapForm.Button6Click(Sender: TObject);
var
obj:CMapXStyle;
FoundFeature: FindFeature;
lyr:CMapXLayer;
begin
Map1.Layers.item('USA').editable:=true;
Map1.Layers.item('USA').begin
Access(1);
lyr:= Map1.Layers.item('USA');
FoundFeature := Map1.Layers.Item('USA').Find.Search('OK', EmptyParam);
if FoundFeature.FindRC mod 10 = 1 then
begin
obj:=FoundFeature.Style
obj.RegionPattern:=2;
obj.RegionColor:=miColorRed;
FoundFeature.Style:=obj;
lyr.Refresh;
end;
Map1.Layers.item('USA').EndAccess(0);
end;