Re: PaintBox image trouble
- From: "UN" <ukko_noa@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 11:10:34 +0300
"Rob Kennedy" <me3@xxxxxxxxxxx> wrote in message news:3ps2s7FbubeeU1@xxxxxxxxxxxxxxxxx
If the calculations are lengthy, but they don't change often, then you can paint the image once to a TBitmap, and then in your OnPaint handler, just use Canvas.Draw(Bitmap, 0, 0) to copy the pre-drawn bitmap onto the screen.
Ok: Moon :TBitmap; s1, s2 :string;
Procedure TForm.FormShow;
begin
CountMoon(s1, s2);
Moon := TBitmap.Create;
DrawMoon(s1, s2);
end;Procedure TForm.DrawMoon(s1,s2 :string);
begin
with Moon do begin
{set moon image dimensions}
end;
with Moon.Canvas do begin
{draw it}
end;
end;Procedure TForm.?????????(Sender: TObject); {with which OnPaint handler? No PaintBox any more}
begin
Canvas.Draw(Moon, 0, 0); {this will end in 'incompatible types' }
end;
.
- References:
- PaintBox image trouble
- From: UN
- Re: PaintBox image trouble
- From: Rob Kennedy
- PaintBox image trouble
- Prev by Date: Re: PaintBox image trouble
- Next by Date: Re: Delphi and DSP
- Previous by thread: Re: PaintBox image trouble
- Next by thread: TWordApplication question
- Index(es):