Sound like a classic case of giving the user the options.
I would leave the bitmap as it is and then give the user the option of how to see it.
ie. 1. They can have scroll bars if the Image is too big - So aspect ratio is okay.
2. Scale it to fit inside the maximum size of the TImage, and place the TImage
on a fixed/non-scrollable panel. Again aspect ratio is okay, it may just end up quite
small.
3. Leave Image size alone and crop the image.
All three options means you can have a fixed area allocated to displaying the picture
- the user gets to make the choice - as to what is best for them.
Myles
-----Original Message-----
From: Alistair George [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, July 01, 1999 12:39 PM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Image size
Ahh, I see where ur coming from; it aint that easy - I cant change the Image size - it
is fixed due to interface limitations.
CopyDibIntoImage(TestDib, Image2);
image2.Picture.Bitmap.Height:=clientheight;
image2.Picture.Bitmap.width:=clientwidth;
With the above image2 set to stretch it fits the bitmap to scale, but crops as I
previously described according to image height and width charateristics. I think what
I gonna have to do is frig around with Image bitmap to suit the stretch-ability of the
component size and use that as the visual, but use the 'TestDib' as the actual picture
store as that hasnt been frigged with.
Chrs,
Al+
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
> Behalf Of Myles Penlington
> Sent: Thursday, 1 July 1999 12:15
> To: '[EMAIL PROTECTED]'
> Subject: RE: [DUG]: Image size
>
> After you copy to the bitmap, then change the Bitmap display size
> and set stretch to true.
>
> Intially set the bitmap to the same size as the DIB.
>
> TestDib := TWAIN_GetDib(0);
> CopyDibIntoImage(TestDib, Image2);
> IMAGE2.Stretch := True;
> image2.Height:=Clientheight; // Don't change the bitmap
> size, change the picture/control size
> image2.width:=Clientwidth;
>
> Just tried using a TImage at design time.
> eg Load bitmap, Stretch is false so cannot see all of bitmap,
> Set Strech to true - can now see all of it.
> Change size to get aspect ratio correct.
> Myles
>
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
> > Behalf Of Myles Penlington
> > Sent: Thursday, 1 July 1999 11:19
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: [DUG]: Image size
> >
> > Can't you just calculate the required (scaled) size of the
> > Destination bitmap, and then set Stretch = True? May need to put
> > it on a Scrollable panel?
> > Myles
>
> Hi Myles. If I did that, it would crop the bitmap.
> As per the following:
> TestDib := TWAIN_GetDib(0);
> image2.Picture.Bitmap.Height:=Clientheight;
> image2.Picture.Bitmap.width:=Clientwidth;
> CopyDibIntoImage(TestDib, Image2);
application/ms-tnef