Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Canvas does not allow drawing

21 views
Skip to first unread message

Kris Kelly

unread,
Nov 20, 2001, 9:22:21 PM11/20/01
to
I'm creating component which is a descendant of TImage, I'm using
SetWindowRgn in the component.

So far, the functionality of the component is fine, but if all instances are
deleted at design time, the resize handles remain, they cannot be deleted
except by adding another control or changing focus (if there is another
control on there, focus jumps automatically and there isn't a problem).

I did a bit of searching and found references to lack of resources
(unlikely, I'm using a 1.2Ghz Athlon with 512MB Ram and over 130GB of
storage).
I also found a post suggesting locking the canvas during painting which I
tried but it doesn't appear to help.

Can anyone suggest a way around it?

procedure Paint;
var
Dest: TRect;
begin

Canvas.Lock;
Dest := Rect(0, 0, TileImage.Width, TileImage.Height);

with Canvas do
begin

CopyMode := cmSrcCopy;
StretchDraw(Dest, TileImage);

end;

SetBounds (Left,Top,Width,Height); // call to function which sets the region
Canvas.Unlock;
end;

Kris Kelly

unread,
Nov 20, 2001, 9:27:42 PM11/20/01
to
Sorry, not TImage, TCustomControl

"Kris Kelly" <kris...@hotmail.com> wrote in message
news:xdEK7.10074$%j6.9...@news1.cableinet.net...

Kris Kelly

unread,
Nov 20, 2001, 9:27:41 PM11/20/01
to
Sorry, not TImage, TCustomControl

"Kris Kelly" <kris...@hotmail.com> wrote in message
news:xdEK7.10074$%j6.9...@news1.cableinet.net...

Kris Kelly

unread,
Nov 20, 2001, 9:27:42 PM11/20/01
to
Sorry, not TImage, TCustomControl

"Kris Kelly" <kris...@hotmail.com> wrote in message
news:xdEK7.10074$%j6.9...@news1.cableinet.net...

Kris Kelly

unread,
Nov 20, 2001, 9:27:42 PM11/20/01
to
Sorry, not TImage, TCustomControl

"Kris Kelly" <kris...@hotmail.com> wrote in message
news:xdEK7.10074$%j6.9...@news1.cableinet.net...

Edwin

unread,
Dec 16, 2001, 11:09:19 AM12/16/01
to
The cases in which I've seen this, is when your computer is running out of
resources.... Maybe you should look in that direction... How large is your
bitmap, what color mode is it in etc.

"Kris Kelly" <kris...@hotmail.com> schreef in bericht
news:xdEK7.10074$%j6.9...@news1.cableinet.net...

Shahzad Latif

unread,
Dec 24, 2001, 10:26:52 AM12/24/01
to
I have experianced such issues a lot with Win98, may be because of
poor memory allocation. Typically, you will get this kind of error if
canvas is still drawing something in your previous session not cleared
yet, ie., control is not back yet or ofcourse open GL.

Shahzad

0 new messages