The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to Add Text using OriginC?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] 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
rainlane Posted - 07/09/2017 : 10:39:52 PM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 94
Operating System:Window 7

In the Origin Layer , I can Rignt-Click and select Add Text to add text.



But how to achieve it by OriginC ?
At the sametime , how to set it's position ?



forum
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 07/10/2017 : 05:16:59 AM
Hi,

In Origin C, the GraphObject class provides methods and properties common to control Origin graph objects.

I wrote a simple example that may help to understand:

void AddText()
{
    GraphPage gp;
    gp.Create("Origin");
    GraphLayer gl = gp.Layers(0); // get the first layer
    if(gl)
    {
    	// add a Text named MyText
        GraphObject    	go = gl.CreateGraphObject(GROT_TEXT);
        go.SetName("MyText");
        if( go )
        {
        	go.Text = "This is a new label.";
        	go.Top = 100;
        }        
        gl.GetPage().Refresh();
    }
}


Please go to these pages for more details:
http://www.originlab.com/doc/OriginC/ref/GraphObject
http://www.originlab.com/doc/OriginC/examples/Add-Graph-Object

Regards,
Yuki
OriginLab

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000