Date: Sat, 14 Sep 2002 10:17:27 +0100 Newsgroups: borland.public.delphi.graphics Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va Organization: MGCSoft Message-ID: Subject: Re: Trick to scaling TImage.Picture.Bitmap? From: Gordon Whittam Reply-To: gordon@mgcsoft.com References: <3d81102e.293459502@forums.borland.com> NNTP-Posting-Host: 62.137.127.10 X-Trace: newsgroups.borland.com 1031994865 62.137.127.10 (14 Sep 2002 02:14:25 -0700) Lines: 22 Path: newsgroups.borland.com!not-for-mail Xref: newsgroups.borland.com borland.public.delphi.graphics:51229 In article <3d81102e.293459502@forums.borland.com>, Michael Fullerton wrote: > For large images in an app I resize the TImage to fit the screen. > Because I have some code to draw a rectangle with the mouse using > DrawFocusRect (I want to select part of the image), I also need to > resize Image.Picture.Bitmap. If I don't resize Image.Picture.Bitmap > for the large images the rectangle is drawn in the wrong location. > In case you haven't grasped what's going on. There are two canvas' in a TImage. The one you see which is the control's canvas which you can't access/write to (normally) and the bitmap's canvas. TImage.Canvas *is* (if the graphic is a bitmap) the bitmap's canvas *not* the control's canvas so all drawing is done in the bitmap's coordinates. Each time you draw to TImage.Canvas the bitmap is drawn to the control's canvas, how it appears on the control's canvas depends on Stretch, Center, AutoSize etc. Does that help Gordon