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;

  • 相关阅读:
    Vue 组件之间传值(父子组件传值,vuex传值)
    利用computed和watch实现监听Vuex状态监听
    ESlint+VSCode自动格式化
    MySQL之分组查询(DQL)
    MySQL之排序查询(DQL)
    MySQL之条件查询(DQL)
    MySQL之概述
    jQuery之轮播图
    jQuery之添加删除记录
    jQuery之爱好选择
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940979.html
Copyright © 2011-2022 走看看