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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 SwitchTo not Transfer IO.Params ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
wesleybobato Posted - Mar 02 2016 : 18:39:56
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.
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 03 2016 : 00:46:16
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