• 位图显示地图


     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;

  • 相关阅读:
    Java 流(Stream)、文件(File)和IO
    归并排序(Java)
    TreeMap和TreeSet在排序时如何比较元素?Collections工具类中的sort()方法如何比较元素?
    动态规划—矩阵链乘法
    SQL Server 行列转换
    dropdownlist无刷新传值
    ASP.NET在主题中添加CSS文件
    asp.net网站后台退出后,点后退按钮仍能进,如何安全退出
    下拉框数据绑定两种方式
    win7安装IIS及将网站发布到IIS上
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940979.html
Copyright © 2020-2023  润新知