"Chrissy R" <[EMAIL PROTECTED]> wrote on 8/02/2001 20:55:48:
<snip>
>Separately:
>Your example worked except that if the design size of the image is
>small - 100x100 - then the image can be resized but the image on the
>bits past 100 is either direction does not draw. If I set the design
>time size to 2000x2000 and then resize the image at runtime I get to
>draw on the total surface. This, to me, shows a strange behaviour
>that I can not explain. I think that your example works for what I
>want if I make the image big at design time.
The problem seems to be that the underlying DIB of the TImage doesn't
get properly resized. If you're using a TBitmap as a back buffer then
resize that first and assign it to the Picture property of the Image.
Something like:
void __fastcall TViewForm::ViewPanelResize(TObject *Sender)
{
framebuffer->Width = Image1->Width;
framebuffer->Height = Image1->Height;
Image1->Picture->Assign(framebuffer);
}
This forces the bitmap that the TImage's picture is stored in to be
properly resized when the form size changes, which should fix the
problem with not being able to draw to the whole image.
>Also, if I make the image more than a bit over 2000 (probably 2048 or
>2047) then run the app it comes up with an access violation. These two
>things make me think that there is a problem with the image component.
>This could be because it is meant to have an image in it and not be a
>drawing surface.
Can't say I've tried to use a TImage that size. However a 2048x2048x24
image is going to take up something like 12meg of ram, which is a
little expensive. If you really need to support images this size I'd
suggest trying something a little less memory hungry, even if it means
a relatively large amount of time spent drawing.
I just had a play around with an alternative option... a form with a
couple of TScrollBars and a TImage which I redraw in the OnChange event
of the scrollbars and the OnResize even of the form. It takes a bit
more coding to get it right, but you get a lot more control over what
happens.
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"