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
 Add Edge TImageEnMView.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wesleybobato

Brazil
367 Posts

Posted - Apr 11 2013 :  15:29:31  Show Profile  Reply
Hello William could help me?
Sera that you know how to optimize the code below as well before long, there will be another way to add edge faster?

procedure TFrmStudio.CreateBorderedImage;
var
OrigWidth, origHeight: integer;
oLeft, oTop, oRight, oBottom: integer;
sSource: TImageEnVect;
I: Integer;
begin
sSource := TImageEnVect.Create(nil);
Screen.Cursor := crHourGlass;
oLeft := 0;
oTop := 110;
oRight := 0;
oBottom := 110;
try
for I := 0 to Pred(ImgStudio.ImageCount) do
begin
sSource.IO.LoadFromFile(ImgStudio.ImageFileName[I]);
OrigWidth := sSource.IEBitmap.Width;
OrigHeight := sSource.IEBitmap.Height;

sSource.BackGround := clBlack;

// top
sSource.Proc.ImageResize(OrigWidth, OrigHeight + oTop, iehCenter, ievBottom);
// bottom
sSource.Proc.ImageResize(OrigWidth, OrigHeight + oTop + oBottom, iehCenter, ievTop);
// left
sSource.Proc.ImageResize(OrigWidth + oLeft, OrigHeight + oTop + oBottom, iehRight, ievCenter);
// right
sSource.Proc.ImageResize(OrigWidth + oLeft + oRight, OrigHeight + oTop + oBottom, iehLeft, ievCenter);

//sSource.Background := clBtnFace;

sSource.IO.SaveToFile(ImgStudio.ImageFileName[I]);
ImgVendas.ReloadImage(I);
end;
finally
FreeAndNil(sSource);
Screen.Cursor := crDefault;
end;
end;

w2m

USA
1990 Posts

Posted - Apr 11 2013 :  17:37:46  Show Profile  Reply
Version 4.3.0 has a new unit called iexhelperfunctions.pas. One of the new functions is Bitmap.IEConvertToThumbnail. It is very fast and works well:
procedure TForm1.IEConvertToThumbnail1Click(Sender: TObject);
{ Convert TBitmap to the specified size with or without a border or a shadow. }
var
  iMaxX: Integer;
  iMaxY: Integer;
  iCanStretch: boolean;
  iQualityFilter: TResampleFilter;
  iAddBorder: boolean;
  iBorderColor: TColor;
  iAddShadow: boolean;
  iBlurRadius: Integer;
  iShadowOffset: Integer;
  iShadowColor: TColor;
  iBackgroundColor: TColor;
begin
  ImageEnView1.Proc.SaveUndo();
  Undo1.Enabled := ImageEnView1.Proc.CanUndo;
  iMaxX := StrToIntDef(Width1.Text, 320);
  iMaxY := StrToIntDef(Height1.Text, 240);
  iCanStretch := CanStretch1.Checked;
  iQualityFilter := TResampleFilter(ResampleFilter1.ItemIndex);
  iAddBorder := AddBorder1.Checked;
  iBorderColor := BorderColor1.Selected;
  iAddShadow := AddShadow1.Checked;
  iBlurRadius := StrToIntDef(BlurRadius1.Text, 4);
  iShadowOffset := StrToIntDef(ShadowOffset1.Text, 4);
  iShadowColor := ShadowColor1.Selected;
  iBackgroundColor := ThumbnailBackgroundColor1.Selected;
  ImageEnView1.Bitmap.IEConvertToThumbnail(iMaxX, iMaxY, iCanStretch, iQualityFilter, iAddBorder,
    iBorderColor,
    iAddShadow, iBlurRadius, iShadowOffset, iShadowColor, iBackgroundColor);
  ImageEnView1.Update;
  StatusBar1.Panels[2].Text := 'Width: ' + IntegerToString(ImageEnView1.Bitmap.Width);
  StatusBar1.Panels[3].Text := 'Height: ' + IntegerToString(ImageEnView1.Bitmap.Height);
end;

My EBook will have a new chapter in it that shows how to use all the iexHelperFunctions.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 12 2013 :  05:06:20  Show Profile  Reply
Thank you once again for your Attention William, Everything Good
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 12 2013 :  05:50:28  Show Profile  Reply
Hello I did what I Willian Download Your Book Looking for Chapter iexHelperFunctions on and on and iexShellThumbnails not found I have to buy it again?

Thank you for your return.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 12 2013 :  09:14:41  Show Profile  Reply
No you do not have to purchase again. The chapter on iexHelperFunctions has not been published yet. I probably will publish it following the next release of ImageEn so I can add more chapters that cover the ImageEn enhancements.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 12 2013 :  11:08:00  Show Profile  Reply
Thank You For Your Attention a big hug.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: