ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Problem with alClient in TImageEnVect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aruest

Canada
11 Posts

Posted - Sep 19 2016 :  08:01:09  Show Profile  Reply
I drop a TImageEnVect on a panel control. The panel control's Align property is set to alClient. The TImageEnvect align property is also set to alClient.

When the user runs the application and maximizes the window, the TImageEnVect's size remains to the size it was before the maximize command.

In other words it remains smaller than the new panel size.

My understanding of alClient was that controls could automatically resize.

Is this behaviour different in TImageEnVect?

w2m

USA
1990 Posts

Posted - Sep 19 2016 :  09:37:19  Show Profile  Reply
No. It is not different. A small test project works correctly here. Is it possible some code is causing the problem, or maybe the TImageEnVect is not in the panel?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

aruest

Canada
11 Posts

Posted - Sep 19 2016 :  10:19:03  Show Profile  Reply
Bill,

If I drop the TImageEnVect directly on a form, when I maximize the form, the TImageEnVect correctly resizes.

However, if I first drop a TPanel onto the form, set it to alClient and then drop the TImageEnVect onto the TPanel such that the TIMageEnVect is a child control of the TPanel and is also set to alClient, then when I maximize the form, the TImageEnVect remains at it's original size.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 19 2016 :  10:20:20  Show Profile  Reply
I can not duplicate your results.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

aruest

Canada
11 Posts

Posted - Sep 19 2016 :  10:31:44  Show Profile  Reply
First image shows the sample project in the IDE:
I've made the background clRed just to make identification easier




The I run the application and this it what it shows:





Finally, if I maximize the form, this is what appears:




Notice the grey rectangle in the middle which corresponds to the form's original size.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 19 2016 :  10:52:53  Show Profile  Reply
I have duplicated your findings, except the TImageEnVect is properly aligned to the client panel when maximized. The "white" rectangle in the center is the bitmap not the previous form dimensions. You can correct the problem with this:
procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnVect1.Proc.Resample(ImageEnVect1.ClientWidth, ImageEnVect1.ClientHeight);
  ImageEnVect1.IEBitmap.Fill(clRed);
  ImageEnVect1.Update;
end;

or

procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnVect1.Clear;
  ImageEnVect1.Update;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

aruest

Canada
11 Posts

Posted - Sep 19 2016 :  11:23:07  Show Profile  Reply
Bill,

Thank you very much.

Your code works fine when it is included in the OnResize event of the main form.

Thank you!

Andre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 19 2016 :  11:30:58  Show Profile  Reply
Be advised that if you load an image into the background image, it too will be affected. So I would not use the OnResize event for this unless you plan on not loading a background image.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

aruest

Canada
11 Posts

Posted - Sep 19 2016 :  12:19:35  Show Profile  Reply
I was not planning on loading an image onto the background.

Thank you for the advice!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: