Autor Beitrag
ShadowThief
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278



BeitragVerfasst: Do 18.09.03 07:55 
hallo,

ich möchte ein programm schreiben, mit dem man auf einem TImage (ein großes bild, ca 1500x2000 pixel) bereiche definieren können soll. z. B. habe ich das bild eines geschäftsbriefes und jetzt möchte ich die unterschrift einrahmen, und dann die adresse, die anrede usw. ... ich hab jetzt angefangen für die Rahmen ein TShape zu verwenden, das hab ich auf stRectangle gestellt habe (Pen.Style auf bsClear, damit das rechteck durchsichtig ist).

allerdings stoße ich jetzt an die granzen meiner ideen, denn man soll das rechteck vergrößern und verkleinern können. am schönsten fände ich es, wenn man das rechteck wie ein windows fenster vergrößern könnte. leider ist das standardmäßig mit TShape nicht möglich.

Habt ihr eine bessere idee, also entweder eine andere komponente als TShape, die man schöner vergrößern und verkleinern kann. oder halt allgemein eine idee, wie man das schön lösen könnte.

vielen dank.

shadow.

Moderiert von user profile iconTino: Überflüssige Absätze entfernt.
highhatcompy
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win2000,Win XP,Linux(SuSE9.2)
Delphi 5 Prof.
BeitragVerfasst: Fr 03.10.03 12:45 
Hi,

du könntest es auch auf die alte gute Art machen :D ,zuerst fragst du die Mousepos ab, wenn die linke M-Taste getrücht wird und dann nochmal wenn Du sie wieder loslaest! Den Rahmen zeichnest Du dann mit Lineto(x,y) (du must mit Linetto ein Rechteck zeichnen immer wenn die Mouse bewegt wird) auf das Canvas des Bildes. Zum besserem Verständnis:
ausblenden volle Höhe 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:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
var
  Form1: TForm1;
  ixs,iys,ixe,iye : integer;

implementation

{$R *.DFM}

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

begin
     ixs:=x;
     iys:=y;
     form1.Tag:=2;

end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
     if form1.tag=2 then
     begin


     end;
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
     form1.Image1.Update;
          form1.Image1.Canvas.Brush.Color := clred;
          form1.Image1.Canvas.MoveTo(ixs,iys);
          form1.Image1.Canvas.LineTo(ixs,y);
          form1.Image1.canvas.LineTo(x,y);
          form1.Image1.Canvas.LineTo(x,iys);
          form1.Image1.Canvas.LineTo(ixs,iys);
     form1.tag:=0;
end;

end.


MfG
ShadowThief Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278



BeitragVerfasst: Fr 03.10.03 16:15 
wow ich hab schon gar nicht mehr mit einer antwort gerechnet. ich habs jetzt tatsächlich mit TShape gemacht. die lösung, die ich jetzt habe ist zwar nicht besonders bedienerfreundlich, aber ich hatte einfach nicht die geduld mich jetzt da stundenlang reinzuhängen.

trotzdem danke.

shadow.

Moderiert von user profile iconTino: Überflüssige Absätze entfernt.
highhatcompy
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win2000,Win XP,Linux(SuSE9.2)
Delphi 5 Prof.
BeitragVerfasst: Sa 04.10.03 12:52 
Man soll die Hoffnung eben nicht aufgeben !!! :D

MfG
highhatcompy
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win2000,Win XP,Linux(SuSE9.2)
Delphi 5 Prof.
BeitragVerfasst: Sa 04.10.03 12:53 
Titel: Was lange wehrt, wird auch mal gut!!!
highhatcompy hat folgendes geschrieben:
Man soll die Hoffnung eben nicht aufgeben !!! :D

MfG
ShadowThief Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278



BeitragVerfasst: Sa 04.10.03 14:13 
Titel: Re: Was lange wehrt, wird auch mal gut!!!
highhatcompy hat folgendes geschrieben:
highhatcompy hat folgendes geschrieben:
Man soll die Hoffnung eben nicht aufgeben !!! :D

MfG