Using XE7 with WPT 7.21
I want to identify one of several images in a document for providing editing functionality for this image.
So, I insert the original image into the document using the following code, and try to keep some identification of that image using the properties FileName, Extra, ObjTag and Tag
Code
TextObject := TWPOImage.Create(WPRichText1.Memo.RTFData); TextObject.LoadFromFile(sFle);TextObject.FileName := 'Paint'; TextObject.Extra := 'Paint';TextObject.ObjTag := 6969;TextObject.Tag := 6969;WPRichText1.TextObjects.Insert(TextObject);
If I remain in the current editing sesión of the document, I can retrieve those properties, but if I save the document, and later open again, then those properties are not saved in the RTF.
I want to use the following code, but any of the FileName, Extra, ObjTag and Tag has any value.
Code
if WPRichText1.TextObjects.SelectedObj <> nil then
begin
if WPRichText1.TextObjects.SelectedObj.IsImage then
begin
if WPRichText1.TextObjects.SelectedObj.ObjRef.FileName = 'Paint' then
begin
// Create a temp file
sFle := gsProgs + '\temp\paint.bmp';
WPRichText1.TextObjects.SelectedObj.ObjRef.SaveToFile(sFle);
frmPaint := TfrmPaint.Create(Self);
frmPaint.ShowModal;
frmPaint.Free;
// Reload the modifyed image
WPRichText1.TextObjects.SelectedObj.LoadObjFromFile(sFle);
WPRichText1.TextObjects.SelectedObj.ObjRef.FileName := 'Paint';
DeleteFile(sFle);
end;
end;
end;
Alles anzeigen
So, what property of the actual object must I use to persist a value for identifying that image