These seem like great functions to help user interactions, but the best I could manage so far was a very specifically sized and colored text box
'Gotta have some shape set as SDim Test As New OnScreenText Test.SetTextAndPosition "This is the bad shape!", S.CenterX, S.CenterY Test.SetTextColor (RGB(255, 0, 0)) Test.Show
The SetTextColor command did nothing (I may be using the wrong colort type, but there was no error message). The font is fairly specific and small.
Is there more information or examples of these functions anywhere? Ideally I would like to draw a box around corrupt shapes, for example. Or even better an outline to the shape, etc.
Maybe your RGB function has been return a invalid number after auto cast, RGB function returns a float number, SetTextColor expects a int number.
This exemple show how draw a curve onScreen,
Making a Zig Zag Tool for CorelDRAW and Corel DESIGNER - Docs & Tutorials - Developer Area - CorelDRAW Community
I have this code too,
SelectByWay/SelectByWay.cs at master · bonus630/SelectByWay (github.com)
Is in C#, but the call to corel API is the same
Thanks a lot, I figured how to show curves, which is pretty cool (if a little annoying that you cannot have text and curves at once (as far as I can tell)).
After digging through documentation, I realized that the RGB() function returns Long. So I built this:
Set S = ActiveSelectionRange.Shapes.First
Dim Col As New Color
Col.RGBAssign 255, 0, 0
Dim Test As New OnScreenText
Test.SetTextAndPosition "This is the bad shape!", S.CenterX, S.CenterY
Test.SetTextColor RGB(255, 0, 0)
Dim Zest As OnScreenCurve
Set Zest = Application.CreateOnScreenCurve()
Zest.SetPen RGB(255, 0, 0), 200, cdrOnScreenCurvePenDash
Well, there are no error messages, but there are zero changes anywhere either.
Am I doing something wrong or is this functionality just half baked?
apparently this function is broken
Eh, not the thing I wanted to hear...
Well, there's still hope that someone may know some undocumented workaround. Small hope, but still.
You can try some hacks to display curve and a text, use only CreateOnScreenCurve(), to display a curve of a text joined yours others curves
Color color = app.CreateColor();
color.RGBAssign(255, 0, 0);
string text = "Test";
double positionX = 0;
double positionY = 0;
app.Optimization = true;
OnScreenCurve ui = app.CreateOnScreenCurve();
Shape q = app.ActiveLayer.CreateRectangle2(positionX, positionY, 1, 1);
Shape t = app.ActiveLayer.CreateArtisticText(positionX, positionY, text);
Curve c = app.CreateCurve();
ui.SetPen(color.RGBValue, 10, cdrOnScreenCurvePenStyle.cdrOnScreenCurvePenSolid);
app.Optimization = false;
app.Optimization = false;