Script to load image
All  1-6  7-9

Previous
Next
 From:  Michael Gibson
8571.7 In reply to 8571.6 
Hi track, the function AddImage() in commands\Image.js is how MoI's image command creates new images. But it's a little complicated since all the UI and pointpicker bindings and such are in there as well.

Here's a streamlined example that just uses some fixed parameters:

code:
    var filename = 'c:\\img\\test.jpg';
    var baseframe = moi.vectorMath.createTopFrame();
    var cornerpt = moi.vectorMath.createPoint(20,20,0);

    var factory = moi.command.createFactory( 'backgroundimage' );

    // background image factory has 3 inputs:
    // 0 : String - FileName
    // 1 : CoordinateFrame - Plane that gives orientation of bottom-left corner of image
    // 2 : Point - upper-right corner point.

    factory.setInput( 0, filename );
    factory.setInput( 1, baseframe );
    factory.setInput( 2, cornerpt );

    factory.commit();


Hope that helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Message 8571.8 deleted 1 Sep 2017 by BEMFARMER

Previous
 From:  track
8571.9 In reply to 8571.7 
Thanks
It works
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-6  7-9