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 do I change TIETextLayer properties in C++?

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
FTKS Posted - Jun 01 2022 : 05:35:09
Hello ImageEn Team,

after creating a textlayer in my ImageenView window.

I tried to access the properties of the TIETextLayer behind it based on the delphi examples given from the online documentation.
While the code itself does compile, accessing the properties leads to an access violation error. What am I doing wrong/ what am I missing?

I am using C++ Builder 10.2 Tokyo and ImageEn 8.7.6.

This is the code which I have tried:

ImageEnView1->LayersAdd(ielkText);

//Either
TIETextLayer(ImageEnView1->CurrentLayer).Text = "This is a test text message"; //Leads to the access violation error

//or
TIETextLayer* txtlayer = new TIETextLayer(ImageEnView1->CurrentLayer); //also leads to the access violation error
txtlayer->Text = "This is a test text message";

Thank you in advance

With best Regards

Stefan

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 08 2022 : 19:26:50
Hi Stefan

You should use:

   ((TIETextLayer*)ImageEnView1->CurrentLayer)->Text = "Test";


Or:


void __fastcall TForm1::Button1Click(TObject *Sender)
{
  ImageEnView1->LayersAdd(ielkText);

  TIETextLayer *txtlayer;
  txtlayer = dynamic_cast<TIETextLayer*>(ImageEnView1->CurrentLayer);
  if (txtlayer != NULL)
    txtlayer->Text = "This is a test text message";

  ImageEnView1->Update();
}


https://docwiki.embarcadero.com/RADStudio/Sydney/en/Dynamic_cast_(C%2B%2B_Type_Cast_Operator)
https://docwiki.embarcadero.com/RADStudio/Sydney/en/Static_cast(typecast_Operator)



Nigel
Xequte Software
www.imageen.com