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
 How to access IE control of Parent Form?

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
yogiyang Posted - Mar 26 2021 : 08:05:53
Hello,

I have three forms in my Project.

Form1
Form2
Form3

I have placed ImageEnView in Form1 and Form2.

I am opening Form2 from Form1 using MyForm2.ShowModal.

Here I want to give users facility to users to correct image loaded in Form2's ImageEnView from Form3.

In Form3 I have placed a few Trackbars and user can use these Trackbars to adjust Brightness, Contrast, Saturation, etc.

For this to work I would need to be able to access ImageEnView control placed in Form2.

I am trying to following code:
Form2.ImageEnView2.Proc.SaveUndo(ieuFullLayer);
Form2.ImageEnView2.LayersDeselectAll;
Form2.ImageEnView2.LayersCurrent := 1;
Form2.ImageEnView2.Proc.IntensityRGBall(tbRed.Position, tbBlue.Position, tbGreen.Position);
Form2.ImageEnView2.Update;


But this code is giving error: Access Violation.

What mistake am I making here?

TIA



Yogi Yang
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 04 2021 : 01:47:15
You never create Form2. You create a TForm2 but assign it to the variable frm, so naturally any calls to the unitialized Form2 will fail:


procedure TForm1.btnLoadFoirm2Click(Sender: TObject);
var
  frm: TForm2;
begin
  frm := TForm2.Create(Self);
  try
    frm.ShowModal;
  finally
    FreeAndNil(frm);
  end;
end;


Change this code to:

procedure TForm1.btnLoadFoirm2Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  try
    Form2.ShowModal;
  finally
    FreeAndNil(Form2);
  end;
end;


Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Mar 27 2021 : 09:35:01
I have done all necessary things as follows:

From Form1 I create and show as Modal Form2 and from Form2 I create Form3 and show as Modal.

I will send you a sample next week

TIA

Yogi Yang
xequte Posted - Mar 26 2021 : 22:30:02
Hi Yogi

I don't see anything wrong there (assuming Form2 is created). Have you put a breakpoint before this code to see which object(s) are not instantiated?

You might need to send me a simple demo to look at.


Nigel
Xequte Software
www.imageen.com