Bitmap display Map

Source: Internet
Author: User

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 monitoring site 574 613 283 321
2. Monitoring site 517 563 127 162
3, 4, monitoring site 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 ('abscissa: % s ordinate: % 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 [pressure: % s] [Water Level: % s] [Ph: % s] [residual chlorine: % s] [turbidity: % s]',
[Fieldvalues ['map _ chk_station '], '',
'','']);
Panedata. Caption: = s;
End else
Panedata. Caption: = '';
Next;
End;
End;
Finally
Unlock;
End;
End;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.