I've managed to create a very basic annotation, but there's a lot of information missing from the documentation.
My goal is a simple textbox like this:
This is what I have so far but I cannot control
1) The border color / alpha
2) The internal color / alpha
3) The text alignment
4) The font parameters - size, name, color
5) I'd like to flatten the annotation so that it cannot be edited once applied.
Code: Select all
PXC_Rect myRect;
myRect.bottom = 100;
myRect.top = 200;
myRect.left = 100;
myRect.right = 200;
IPXS_Inst pxInst = pxcInst.GetExtension("PXS");
uint nTextMUAtom = pxInst.StrToAtom("FreeText");
Debug.WriteLine("textmarkup atom is:" + nTextMUAtom);
IPXC_Annotation pAnnot = inPage.InsertNewAnnot(nTextMUAtom, myRect);
IPXC_AnnotData_FreeText TextMUData = (IPXC_AnnotData_FreeText)pAnnot.Data;
TextMUData.Contents = "Hello World";
// These seem to have no effect
//TextMUData.Color.SetRGB(0.0f, 0.0f, 1.0f);
//TextMUData.FColor.SetRGB(0, 0, 0);
//TextMUData.SColor.SetRGB(1.0f, 0.0f, 1.0f);
PXC_AnnotBorder myBorder = new PXC_AnnotBorder();
myBorder.nWidth = 4;
myBorder.nStyle = PXC_AnnotBorderStyle.ABS_Dashed;
TextMUData.set_Border(myBorder);
//TextMUData.TextRotation = 45; // no effect ?
//TextMUData.DefaultTextColor.SetRGB(1.0f, 0.0f, 1.0f); // no effect ?
pAnnot.Data = TextMUData;