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
 SwitchTo not Transfer IO.Params ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wesleybobato

Brazil
367 Posts

Posted - Mar 02 2016 :  18:39:56  Show Profile  Reply
Hi Nigel.

I found an error with this Method not SwitchTo Transfers the parameters from source to destination?

//Here Not Assign IO.Params.
procedure TForm1.Button1Click(Sender: TObject);
var
 bmp : TIEBitmap;
begin
 bmp := TIEBitmap.Create;
  try
   bmp.Read( 'Tulips.jpg' );
   bmp.SwitchTo( ImageEnView1.IEBitmap ); //Here Not Transfer ??
   ImageEnView1.Update;

   ShowMessage( IntToStr( ImageEnView1.IO.Params.OriginalWidth  ) );
   ShowMessage( IntToStr( ImageEnView1.IO.Params.OriginalHeight ) );
  finally
   bmp.Free;
  end;
end;

//Here Normal.
procedure TForm1.Button2Click(Sender: TObject);
begin
 ImageEnView1.IO.LoadFromFile( 'Tulips.jpg' );
 ShowMessage( IntToStr( ImageEnView1.IO.Params.OriginalWidth  ) );
 ShowMessage( IntToStr( ImageEnView1.IO.Params.OriginalHeight ) );
end;


Thank You.

xequte

39052 Posts

Posted - Mar 03 2016 :  00:46:16  Show Profile  Reply
Hi Wesley

SwitchTo() does not assign params. Use Assign() instead.

Note: It will only assign params if they are enabled for the bitmap:

bmp.ParamsEnabled := True;
bmp.Read( 'Tulips.jpg' );


Also. you can use bmp.Width instead of ImageEnView1.IO.Params.OriginalWidth.

P.S. Don't forget to use the button to wrap your code.

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