Einzelnen Beitrag anzeigen

RobertP

Registriert seit: 19. Aug 2006
181 Beiträge
 
Turbo Delphi für Win32
 
#4

Re: Mausposition auf ImgView32

  Alt 17. Sep 2006, 14:05
Schon wieder ein Problem:

In des ImgView32 lad ich ne Grafik, da drauf mach ich ein Layer, wo ich was reinzeichne. Wenn ich jetzt scrolle scrollt zwar die Grafik aber das gezeichnete, also das Layer, bleibt am selben Fleck. Wie krieg ich das Layer dazu dass es mitscrollt?

Mein Versuch war leider net so erfolgreich:
Delphi-Quellcode:
procedure TEditorForm.mapImageScroll(Sender: TObject);
var
P : TPoint;
left, top, right, bottom : Integer;
begin
  left := Trunc(L.Location.Left);
  top := Trunc(L.Location.Top);

  P.X := left - mapImage.Left;
  P.Y := top - mapImage.Top;

  P := mapImage.ControlToBitmap(P);


  left := P.X;
  top := P.Y;
  right := left + 10;
  bottom := top + 10;

  Label3.Caption := IntToStr(left);
  Label4.Caption := IntToStr(top);
  L.Location := FloatRect(left, top, right, bottom);
end;
Robert
  Mit Zitat antworten Zitat