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
 Assign LayerMView & Histogram to dynamically created ImageEnView on TabChange

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
Watsch Posted - Jun 13 2023 : 10:20:38
Hi there,

I create an ImageEnView and a tab at runtime to open/create new images in tabs. But how can I assign the dynamically created components to the Histgram and ImageEnLayerMView so that on a tab change the layers and histogram show the corresponding image "values"?

My code to create a new picture:
procedure TFormToolsBildbearbeitungDateiNeu.ButtonOKClick(Sender: TObject);
var
  TabSheet   : TRzTabSheet;
  TabNummer  : Integer;
  ImageEnView: TImageEnView;
begin
// Create a new tab and assign to PageControl
  TabSheet := TRzTabSheet.Create(FormToolsBildbearbeitungMain.RzPageControl);
  TabSheet.Caption := AdvEditName.Text;
  TabSheet.Name := 'TabSheet' + IntToStr(FormToolsBildbearbeitungMain.RzPageControl.PageCount);
  TabSheet.PageControl := FormToolsBildbearbeitungMain.RzPageControl;

// Create ImageEnView component
  ImageEnView := TImageEnView.Create(TabSheet);
  ImageEnView.Name := 'ImageEnView' + TabSheet.Name;
  ImageEnView.Parent := TabSheet;
  ImageEnView.Left := 0;
  ImageEnView.Top := 0;

    case AdvComboBoxHintergrundinhalt.ItemIndex of
      0: ImageEnView.Background := clWhite;
//      1: ImageEnView.Background := FormToolsBildbearbeitungMain.IEColorButtonHintergrundfarbe.SelectedColor;
      2: ImageEnView.Background := clNone;
    end;

  ImageEnView.Width := StrToInt(AdvEditBreite.Text);
  ImageEnView.Height := StrToInt(AdvEditHoehe.Text);

  ImageEnView.Align := alClient;
  ImageEnView.CenterImage;

  ImageEnView.Visible := TRUE;

  TabNummer := FormToolsBildbearbeitungMain.RzPageControl.PageCount + 1;
  FormToolsBildbearbeitungMain.RzPageControl.ActivePageIndex := TabNummer - 2;

// Set focus on the actual tab
  FormToolsBildbearbeitungMain.RzPageControl.ActivePage.SetFocus;

// Assign the component "ImageEnView" to the component "ImageEnLayerMView"
//  FormToolsBildbearbeitungMain.ImageEnLayerMView.AttachedImageEnView := ImageEnView;

// Close Window
  Close;
end;


However, when changing the tabs, layers and histogram do not update. Below is an example code for the OnTabChange event:

procedure TFormToolsBildbearbeitungMain.RzPageControlPageChange(
  Sender: TObject);
begin
// Hier der aktuellen ImageEn-Komponente die dazugehörigen Komponenten zuweisen
// Histogram, Ebenen, etc...
  HistogramBox.AttachedImageEnProc := ImageEnProc;
end;


As I said, I have no idea. I also tried "FindComponent", etc.. without luck. If anyone could provide me with a code snippet, that would be more than great and highly appreciated.

Thanks in advance,

Watsch

Watsch
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 15 2023 : 06:05:39
Hi

Sorry, I'm out of the office and wasn't able to remotely connect with my dev environment today to test it.

However looking at the code, it makes reference to Form1.ImageEnProc which does not seem to have any purpose. The histogram should be attached to the ImageEnView it relates to, e.g.

HistogramBox.AttachedImageEnProc := ImageEnView1.Proc;

Nigel
Xequte Software
www.imageen.com
xequte Posted - Jun 13 2023 : 11:42:23
Hi

When you say they don't update, do you mean they have no content or they have the original content which does not show any further changes?

Does it work if you explicitly call the Update() methods or assign content, e.g. using:

http://www.imageen.com/help/THistogramBox.UpdateFromBitmap.html

You might need to create a simple demo that shows the issue so I can understand it better.

Nigel
Xequte Software
www.imageen.com