Autor Beitrag
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Mi 27.04.05 22:23 
Hallo Leute hatte vor für mich ein Mapper für Html zu schreiben, hätte vieleicht von euch einer ne' Idee wie ich nun den Bereich auf dem Image am besten markieren könnte.
Ist ja nur zur Überprüfung und braucht nicht im Image gespeichert zu werden.
Image1.Canvas.LineTo (X,Y); oder so ?


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  X1:=Inttostr(x);
  Y1:=Inttostr(y);
  Label1.Caption:=Inttostr(x);
  Label2.Caption:=Inttostr(y);
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  X2:=Inttostr(x);
  Y2:=Inttostr(y);
  Label3.Caption:=Inttostr(x);
  Label4.Caption:=Inttostr(y);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.Clear;
  Memo1.Lines.Add('<map name="Test">');
  Memo1.Lines.Add('<area shape="rect" coords="'+ X1 +','+ Y1 +','+ X2 +','+ Y2 +'" href="http://Test.de/" alt="Test">');
  Memo1.Lines.Add('</map>');
  Memo1.Lines.Add('<p><img src="Test.jpg" width="345" height="312" border="0" alt="Test" usemap="#Test"></p>');
 end;
end.