Re: Increasing size of TBitmap
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 12:01:43 -0500
Bram Bos wrote:
I have a TBitmap on my form (both autosize and stretch are false).
TBitmap has neither an AutoSize nor a Stretch property. You need to be precise about what you're talking about. You have a TImage on your form, not a TBitmap.
Its width and height are 100 pixels. I also use its canvas to draw on. Now I want to dynamically increase the width and height (e.g. when resizing my form) but no can do. The drawable area of the canvas remains 100x100..
That's because then you draw on a TImage's canvas, you actually force the control to create a TBitmap, and then you draw on the TBitmap's canvas. When the TBitmap's canvas changes, it notifies the TImage, which updates its display on the form.
When you resize the TImage, though, you do not resize the TBitmap, so although the TImage's canvas represents a larger area, the TBitmap's canvas hasn't changed. All the TImage really does is copy the contents of the TBitmap onto the screen.
I don't recommend drawing directly to a TImage. Create a TBitmap, draw on it, and then assign the bitmap to the TImage's Picture property.
-- Rob .
- Follow-Ups:
- Re: Increasing size of TBitmap
- From: Bram Bos
- Re: Increasing size of TBitmap
- References:
- Increasing size of TBitmap
- From: Bram Bos
- Increasing size of TBitmap
- Prev by Date: Execute Stream?
- Next by Date: Re: Increasing size of TBitmap
- Previous by thread: Increasing size of TBitmap
- Next by thread: Re: Increasing size of TBitmap
- Index(es):
Relevant Pages
|