Hi, Thanks for the reply.
As I said I had assumed, perhaps incorrectly, that the use of
div on something containing a real would have returned an integer value and things would/should have been happy and again, in the initial example, the compiler did not complain about args 1 to 3... but fell over on arg 4.
Being a knuckle scraper I've tried other things..
procedure TDrawFrame.Paint(Sender: TObject);
var
SheetXSize: Integer;
SheetYSize: Integer;
SheetXCent: Integer;
SheetYCent: Integer;
SheetScale: Real;
XRect1Real: Real;
XRect2Real: Real;
YRect1Real: Real;
YRect2Real: Real;
XRect1: LongInt;
XRect2: LongInt;
YRect1: LongInt;
YRect2: LongInt;
SheetTRect: Trect;
X: Integer;
Y: Integer;
begin
Case SchSheetFVar.Orientate of
0:Case SchSheetFVar.SheetSize of
0:begin SheetXSize:=1189;SheetYSize:=0841; end;
1:begin SheetXSize:=0841;SheetYSize:=0594; end;
2:begin SheetXSize:=0594;SheetYSize:=0420; end;
3:begin SheetXSize:=0420;SheetYSize:=0297; end;
4:begin SheetXSize:=0297;SheetYSize:=0210; end;
end;
1:Case SchSheetFVar.SheetSize of
0:begin SheetYSize:=1189;SheetXSize:=0841; end;
1:begin SheetYSize:=0841;SheetXSize:=0594; end;
2:begin SheetYSize:=0594;SheetXSize:=0420; end;
3:begin SheetYSize:=0420;SheetXSize:=0297; end;
4:begin SheetYSize:=0297;SheetXSize:=0210; end;
end;
end;
Output.Width := Image1.Width;
Output.Height := Image1.Height;
SheetXCent := Output.Width div 2;
SheetYCent := OutPut.Height div 2;
If Image1.Width/SheetXSize > Image1.Height/SheetYSize then
SheetScale := (Output.Width - 20)/SheetXSize else
SheetScale := (Output.Height - 20)/SheetYSize;
*** XRect1Real := SheetXCent - SheetXSize*SheetScale div 2; ***
YRect1Real := SheetYCent - SheetYSize*SheetScale div 2;
XRect2real := SheetXCent + SheetXSize*SheetScale div 2;
YRect2Real := SheetYCent + SheetYSize*SheetScale div 2;
XRect1 := Trunc(XRect1Real);
YRect1 := Trunc(YRect1Real);
XRect2 := Trunc(XRect2Real);
YRect2 := Trunc(XRect2Real);
SheetTRect := Rect(XRect1,YRect1,Xrect2,YRect2); The above falls over on the line with added asterisks with,
drawframe.pas(71,55) Fatal: Internal error 2009071902
I am a novice so when you ask me to 'try removing drawframe.ppu' how would I and what would be the consequences for the rest of the program or do I just ensure they do not make reference to it. You might see I don't really know much..
Oh, just in case it might be relevant DrawFrame is a TFrame....
unit drawframe;
{$mode delphi}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, ExtCtrls, Graphics;
type
{ TDrawFrame }
TDrawFrame = class(TFrame)
Image1: TImage;
Output: TBitMap;
procedure Paint(Sender: TObject);
private
{ private declarations }
MyObj: TObject;
public
{ public declarations }
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end; and I do get a compiler warning,
drawframe.pas(15,15) Warning: An inherited method is hidden by "TDrawFrame.Paint(TObject);"
Thanks again.
EditOh, from your sig..
//-Bugs reported on the forum will be forgotten. Use the bug tracker.
If it is a bug I don't mind following it through via the 'bug tracker'. Unfortunately you may find I am not the most 'focussed' of people so I might give too much irrelevant information.