Is hard to debug when you don't have the code, if you don't mind you can store it somewhere and send me it to PM, I will not share it with no one. If not well I'm not sure how to help you. Do you have a control named BGRAGraphicControl1 placed in the form and contains the event OnRedraw assigned?
Something you can try is to disable the timer in the object inspector, and then enable the timer OnShow event, to ensure that the calling to BGRAGraphicControl1.DiscardBitmap is done only when the component is visible.
procedure TForm1.FormShow(Sender: TObject);
begin
Timer1.Enabled := True;
end;
This is exactly the same line in the same procedure (Timer) as it is in Project1 and that throws no error. I did try to move that line to a called procedure in project1 but it didn't compile (I'd like to know why?)
The procedure must be a method of the form class, not a procedure outside. I suppose is that the bug when you try to move the line but I'm not sure.
I've previously seen reference to SIGSEG on the forum but not understood any of the answers.
Is a memory problem, reading or writing an invalid address or something like that.
As a subsidiary question, is it possible to incorporate the hand images on the form (using TImage ? ) and reference them that way rather than fetch them from 'ProgramDirectory + ...' ?
Is not a good idea since it takes a lot of space in the executable because are stored in a not efficient way. Better use resources.
Go to Project > Project Options > Resources > + Add > Select HourHand.png > OK. Now you have a new resource that will be stored in your executable with the same size as the bitmap has, a few kb.
Then you need to load them with this:
uses
LCLType;
//In your form, add this method:
procedure LoadBitmap(var ABitmap: TBGRABitmap; const ResourceName: String);
procedure TForm1.LoadBitmap(var ABitmap: TBGRABitmap; const ResourceName: String);
var
res: TResourceStream;
begin
res := TResourceStream.Create(HInstance, ResourceName, RT_RCDATA);
if ABitmap <> nil then
ABitmap.Free;
ABitmap := TBGRABitmap.Create(res);
res.Free;
end;
And you call this:
LoadBitmap(HourHand, 'HOURHAND');