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
 ImageEnProc1.rotate view not backcolor
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Feb 08 2019 :  09:42:05  Show Profile  Reply
Hello,
i use ImageEnProc1.rotate(Angle_AdvSpinEdit.floatValue, Antialiasing_CheckBox.Checked, ierfast, clred);
But the background is not changed ?
Why, in a earlier version this works fine.
What can i do ?
This is the source:
procedure TfRotate.Angle_AdvSpinEditChange(Sender: TObject);
begin
  ImageEnProc1.Undo;
  ImageEnProc1.rotate(Angle_AdvSpinEdit.floatValue, Antialiasing_CheckBox.Checked, ierfast, bcolor);
  ImageEnView1.Fit;
end;

And here a example:


Klaus
www.klausdoege.de

xequte

38176 Posts

Posted - Feb 08 2019 :  16:09:15  Show Profile  Reply
Hi Klaus

Sorry, in what way were you wanting the background to change? This image is alpha filled in the null area when rotated. Did you want it filled with a solid color?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Feb 10 2019 :  03:20:20  Show Profile  Reply
Hi Nigel,
yes the background should be filled with the color on the right.
About as:


Klaus
www.klausdoege.de
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 11 2019 :  10:29:58  Show Profile  Reply
Try
ImageEnView1.BackgroundStyle := iebsSolid;
ImageEnView1.Background := clYellow;

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

klausdoege

Germany
389 Posts

Posted - Feb 11 2019 :  11:17:13  Show Profile  Reply
Yes i know.
But i make this:
ImageEnProc1.rotate(45, true, ierfast, clyellow);
And not Background is changed ?

Klaus
www.klausdoege.de
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 11 2019 :  11:33:53  Show Profile  Reply
Ok, but your example shows ImageEnView1.BackgroundStyle := iebsSolid;
ImageEnView1.Background := clBrnFace;

and ImageEnProc1.rotate... does not have a paramter to set the backgroundstyle. So set ImageEnView1.BackgroundStyle := iebsSolid before calling ImageEnProc1.rotate(45, true, ierfast, clyellow).

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

w2m

USA
1990 Posts

Posted - Feb 11 2019 :  12:02:45  Show Profile  Reply
This works:
procedure TForm2.Rotate1Click(Sender: TObject);
begin
  ImageEnView1.BackgroundStyle := iebsSolid;
  ImageEnView1.Background := clYellow;
  ImageEnView1.Proc.Undo;
  ImageEnView1.Proc.Rotate(45, False, ierfast, clYellow);
  ImageEnView1.Fit;
end;


This does not work:
procedure TForm2.Rotate1Click(Sender: TObject);
begin
  ImageEnView1.BackgroundStyle := iebsSolid;
  ImageEnView1.Proc.Undo;
  ImageEnView1.Proc.Rotate(45, False, ierfast, clYellow);
  ImageEnView1.Fit;
end;


Perhaps you need to use Background as well?

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

xequte

38176 Posts

Posted - Feb 11 2019 :  19:23:07  Show Profile  Reply
Hi Klaus

The background color is there, it's just not shown because it is specified as transparent by the alpha channel.

To prevent it occurring, you just need to remove the alpha channel:

ImageEnView1.IEBitmap.RemoveAlphaChannel;

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Feb 12 2019 :  12:45:14  Show Profile  Reply
Hi Nigel,
yes that's the solution.
That should be in the documentation of
procedure Rotate(Angle: Double; AntiAliasMode: TIEAntialiasMode = ierFast; BackgroundColor: TColor = -1);
be mentioned that would be helpful.
Because without it, it will not work
not even with Bill's tip.

Klaus
www.klausdoege.de
Go to Top of Page

xequte

38176 Posts

Posted - Feb 12 2019 :  19:56:05  Show Profile  Reply
Hi Klaus

Yes, that is true. I will add a note to the documentation.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: