Re: Timage.autosize
- From: "Charles Appel" <charlesappel@xxxxxxxxxxxxxx>
- Date: Sun, 12 Jun 2005 22:17:36 GMT
"Miko" <michel.salvagniac@xxxxxxx> wrote in message
news:42ac441c$0$5106$636a15ce@xxxxxxxxxxxxxxx
> Hi,
> I have a very simple application with a Timage and 3 checkboxes:
>
> procedure TForm1.CBAutosizeClick(Sender: TObject);
> begin
> if CBAutosize.Checked then
> Image1.AutoSize:=true else
> Image1.AutoSize:=False;
> Image1.Repaint;
> end;
>
> procedure TForm1.CBStretchClick(Sender: TObject);
> begin
> if CBStretch.Checked then
> Image1.Stretch:=true else
> Image1.Stretch:=False;
> Image1.Repaint;
> end;
>
> procedure TForm1.CBPropClick(Sender: TObject);
> begin
> if CBProp.Checked then
> Image1.Proportional:=true else
> Image1.Proportional:=False;
> Image1.Repaint;
> end;
>
> Once the image has been "Autosized", it's impossible to stretch or to make
> proportional..
> What i am doing wrong?
It is my understanding that if AutoSize is true, the image
component automatically assumes the size of the bitmap.
This may be the problem. Try setting AutoSize to false
before stretching.
BTW - You can simplify your code with:
procedure TForm1.CBAutosizeClick(Sender: TObject);
begin
Image1.AutoSize := CBAutosize.Checked;
Image1.Repaint;
end;
procedure TForm1.CBStretchClick(Sender: TObject);
begin
{ if stretch checked, turn off autosize }
Image1.AutoSize := not CBStretch.Checked;
{ make autosize check box match }
CBAutosize.Checked := Image1.AutoSize;
Image1.Stretch := CBStretch.Checked;
Image1.Repaint;
end;
None of the above has been tested.
Good luck.
--
Charles Appel
"A generation which ignores history has no past - and no future."
Robert Anson Heinlein
.
- Follow-Ups:
- Re: Timage.autosize
- From: Miko
- Re: Timage.autosize
- References:
- Timage.autosize
- From: Miko
- Timage.autosize
- Prev by Date: Audio component
- Next by Date: Re: Keyboard Event
- Previous by thread: Timage.autosize
- Next by thread: Re: Timage.autosize
- Index(es):