zoukankan      html  css  js  c++  java
  • 位图显示地图

     client.ini
    [screen]
    x=1024
    y=768

    map.mdb
    map_id map_chk_station map_x_min map_x_max map_y_min map_y_max
    1 1号监测站 574  613  283  321
    2 2号监测站 517  563  127  162
    3 4号监测站 854  899  34  74

    procedure TFormMain.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    var
      xScreen,yScreen,xMin,xMax,yMin,yMax,xBase,yBase:Integer;
      ini:TIniFile;
      filename,s:string;
    begin
      inherited;
      filename:=ExtractFilePath(Application.ExeName)+'client.ini';
      ini:=TIniFile.Create(filename);
      try
        xBase:=ini.ReadInteger('screen','x',0);
        yBase:=ini.ReadInteger('screen','y',0);
      finally
        ini.Free;
      end;
      xScreen:=Screen.Width;
      yScreen:=Screen.Height;
      paneXY.Caption:=Format('横坐标:%s 纵坐标:%s',[IntToStr(X),IntToStr(Y)]);
      lock;
      try
        dm.cdsTemp.Data:=dm.sc.AppServer.opensql('select * from map');
        with dm.cdsTemp do
        begin
          First;
          while not Eof do
          begin
            xMin:=Round(xScreen/xbase*FieldValues['map_x_min']);
            xMax:=Round(xScreen/xbase*FieldValues['map_x_max']);
            yMin:=Round(yScreen/ybase*FieldValues['map_y_min']);
            yMax:=Round(yScreen/ybase*FieldValues['map_y_max']);
            if (X>=xMin) and (X<=xMax) then
            if (Y>=yMin) and (Y<=yMax) then
            begin
              s:=Format('%s [压强:%s] [水位:%s] [PH:%s] [余氯:%s] [浊度:%s]',
                [FieldValues['map_chk_station'],'','','',
                '','']);
              paneData.Caption:=s;
            end else
              paneData.Caption:='';
            Next;
          end; 
        end; 
      finally
        unlock;
      end;
    end;

  • 相关阅读:
    Spring Boot Devtools 热部署依赖
    SpringBoot 整合 thymeleaf
    spring boot 静态资源的映射规则 (3) 欢迎页面映射
    spring boot 静态资源的映射规则 (2) 替他资源映射
    spring boot 静态资源的映射规则 (1) webjars 资源映射
    css初始化minireset.css
    php递归函数细节
    php的递归函数示例
    php正则字符串提取汉字
    Javascript中的Callback方法浅析
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940979.html
Copyright © 2011-2022 走看看