Hi all,
After a long spell of "Real Life" interfering with programming I got back to
an old project.
After recompiling it with the new Lazarus environment the graphics part went
haywire. The new Lazarus looks sweet btw, very good work guys.
So I created a base app with a Scrollbox1, an Image1 and a button to load a
picture.
After loading a picture the scrollbox is way larger then the picture is, so I
can scroll the picture completely out of view.
Using Form1.Image1MouseMove to manipulate the picture doesn't cover the whole
picture. The cutoff line however changes when the image is scrolled either
way.
The entire source follows
======================
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Image1: TImage;
OpenDialog1: TOpenDialog;
Panel1: TPanel;
ScrollBox1: TScrollBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y:
Integer);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y:
Integer
);
private
{ private declarations }
public
{ public declarations }
origin : TPoint;
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
Image1.Picture.LoadFromFile(OpenDialog1.FileName);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image1.Canvas.Line(Origin.x,Origin.y,X,Y);
Origin.x := X;
Origin.y := Y;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image1.Canvas.Line(Origin.x,Origin.y,X,Y);
Origin.x := X;
Origin.y := Y;
end;
initialization
{$I unit1.lrs}
end.
===================
I'm using Suse Linux 10.3 x64 with latest updates and Lazarus svn 13136
Anybody any ideas?
--
Ger
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives