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
 Actions not working with TImageEnIO/TImageEnProc?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

924 Posts

Posted - May 22 2013 :  04:55:25  Show Profile  Reply
Hi! In ImageEn 4.3.1, it seems I cannot use the included Actions with TImageEnIO and TImageEnProc? The ImageEnView property of the Actions does not show the existing TImageEnIO and TImageEnProc instances! I am forced to use the TImageEnIO and TImageEnProc with TImage instead of TImageEnView because of the missing Transparent property in TImageEnView.

So how can I use the included Actions with TImageEnIO and TImageEnProc?

ehkhalid

27 Posts

Posted - May 22 2013 :  09:04:47  Show Profile  Reply
Hi,
imageenproc1.AttachedTimage := image1;
imageenIo1.AttachedTimage := image1;

you can do it manually by assigning image1 at the property Attachedtimage of both imageen cmponents.

Go to Top of Page

PeterPanino

924 Posts

Posted - May 22 2013 :  12:37:36  Show Profile  Reply
It seems you have misunderstood my comment.
Go to Top of Page

w2m

USA
1990 Posts

Posted - May 22 2013 :  12:48:49  Show Profile  Reply
You can not because there is no Image or ImageEnProc or ImageEnIO property in the action. Actions are relatively new feature so perhaps this may be added later.

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

xequte

38514 Posts

Posted - May 22 2013 :  12:49:27  Show Profile  Reply
Hi Peter

I'm afraid the actions do not support TImage (even those that connect directly with its TImageEnIO or TImageEnProc object).



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

PeterPanino

924 Posts

Posted - May 22 2013 :  13:21:07  Show Profile  Reply
There also seems to be an other issue with Actions: If you assign an action to a Button and the ImageEnView component which is assigned to the Button's Action has no image loaded at program start, then the Button flickers very rapidly and continually. Only after an image is loaded into the ImageEnView the flickering stops.
Go to Top of Page

PeterPanino

924 Posts

Posted - May 22 2013 :  13:46:06  Show Profile  Reply
Now I use this workaround to circumvent this issue:

procedure TForm1.FormCreate(Sender: TObject);
begin
  // Load dummy picture at program start to avoid button flickering:
  ImageEnView1.IO.LoadFromFileGIF('D:\dummy.gif');

Then in the Button's click-handler:

procedure TForm1.ToolButton1Click(Sender: TObject);
begin
  ImageEnView1.Bitmap.Assign(Image1.Picture.Graphic);
  ImageEnViewConvertToGray1.Execute;
  Image1.Picture.Graphic.Assign(ImageEnView1.Bitmap);
  Image1.Repaint;
end;

This works, but it is cumbersome to write click-handlers like this for all the actions I want to perform. it would be better if the actions had TImageEnIO and TImageEnProc properties.
Go to Top of Page

PeterPanino

924 Posts

Posted - May 22 2013 :  14:11:46  Show Profile  Reply
Well, it can be simplified:
procedure TForm1.ToolButton1Click(Sender: TObject);
begin
  ExecuteSendersAction(Sender);
end;

procedure TForm1.ExecuteSendersAction(Sender: TObject);
begin
  ImageEnView1.Bitmap.Assign(Image1.Picture.Graphic);
  TButton(Sender).Action.Execute;
  Image1.Picture.Graphic.Assign(ImageEnView1.Bitmap);
  Image1.Repaint;
end;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: