Delphi+MapX专题图速度很慢,为什么啊?请吕雪松大侠帮帮忙!!(100分)

  • 主题发起人 峻祁连
  • 开始时间

峻祁连

Unregistered / Unconfirmed
GUEST, unregistred user!
为什么作独立点值专题图速度这么慢啊? 数据量4000条记录左右
各位大侠帮我看看错在哪儿了。我想根据客户代码的作废标志(zfbz)的不同
把不同类型的客户区分出来
procedure TfrmMain.DispNoActiveExecute(Sender: TObject);
var
dsKhStatus : CmapXDataset;
flds : CmapXFields;
thmZFKH : CMapXTheme;
pntStyle :CMapXStyle;
myfont : TFont;
i : integer;
begin

AdoQuery1.Close;
AdoQuery1.SQL.Clear;
AdoQuery1.SQL.Add('select khdm,zfbz,tybz,xybz from khxx');
AdoQuery1.Open;

flds := CoFields.Create();
flds.Add('khdm','客户代码',EmptyParam,EmptyParam);
flds.Add('zfbz','作废客户',miAggregationIndividual,EmptyParam);
dsKhStatus := map1.Datasets.Add(miDataSetADO,
adoQuery1.Recordset, 'dstKhStatus','客户代码',EmptyParam,
'烟草销售点', flds, true);

screen.Cursor := crHorse;
flds.Remove(1);
dsKhStatus.Themes.Add(miThemeIndividualValue,flds,EmptyParam,true);
//这句执行起来很慢的,大概要5-6分钟 ,why???
thmZFKH := dsKhStatus.Themes.Item(1);
myfont := TFont.Create();
for i := 1 to thmZFKH.ThemeProperties.IndividualValueCategories.Countdo

begin

pntStyle := thmZFKH.ThemeProperties.IndividualValueCategories.Item(i).Style.Clone;
pntStyle.SymbolType := miSymbolTypeVector

// myfont := TFont(pntStyle.SymbolFont);
// myfont.Name := TFontName('Map Symboles');

//上面改字体的出错,访问ntdll.dll错误 mapX的pntStyle.SymbolFont返回类型
//是IFontDisp类型,但Delphi好像没有这个类型,强制转换后就会出现访问ntdll.dll
//某地址错误,怎么办啊??
pntStyle.SymbolVectorSize := 20;
if i = 1 then

pntStyle.SymbolVectorColor := miColorRed;
if i = 2 then

pntStyle.SymbolVectorColor := miColorGreen;
pntStyle.SymbolCharacter := 35

thmZFKH.ThemeProperties.IndividualValueCategories.Item(i).Style := pntStyle;
end;


thmZFKH.AutoRecompute := true;
thmZFKH.ComputeTheme := true;
thmZFKH.Visible := true;
screen.Cursor := crDefault;
end;
 
我机器上没装MapX,没办法帮你测试。MapX不是很快,但5,6分钟肯定是你的问题了。
 
我想不是我的问题,我追踪过,就是theme.add在浪费时间。我在mapX。com的论坛上也
看到有人发帖子好像和我有同样的问题。
后来我尽量减小了数据量,总算是可以接受了。
 
接受答案了.
 
顶部