<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Apprentice Viewer Background Colour in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9308442#M105647</link>
    <description>&lt;P&gt;You did not specify how you get the images, but i guess you use the camera class. Brian Ekins wrote a greate post about using the camera. &lt;A href="https://modthemachine.typepad.com/my_weblog/2013/09/working-with-cameras-part-2.html" target="_blank" rel="noopener"&gt;you can find it here.&lt;/A&gt; In that post you will find the following code. in the last lines he shows how to set the background color when the picture is saved.&lt;/P&gt;&lt;PRE&gt;Private Sub CreateImage( _
              Apprentice As Inventor.ApprenticeServerComponent, _
              PartOrAssembly As Inventor.ApprenticeServerDocument, _
              Filename As String)
   ' Create a new camera.
   Dim cam As Inventor.Camera
   cam = Apprentice.TransientObjects.CreateCamera

   ' Associate the document with the camera.
   cam.SceneObject = PartOrAssembly.ComponentDefinition

   ' Define the camera and apply the changes.
   cam.ViewOrientationType = _
        Inventor.ViewOrientationTypeEnum.kIsoTopRightViewOrientation
   cam.Fit()
   cam.ApplyWithoutTransition()

   ' Save the result, defining the background color of the image.
   cam.SaveAsBitmap(Filename, 800, 600, _
           &lt;FONT color="#339966"&gt;Apprentice.TransientObjects.CreateColor(255, 255, 0)&lt;/FONT&gt;, _ 
           &lt;FONT color="#339966"&gt;Apprentice.TransientObjects.CreateColor(15, 15, 15))&lt;/FONT&gt;
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2020 20:40:45 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2020-02-10T20:40:45Z</dc:date>
    <item>
      <title>Apprentice Viewer Background Colour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9308407#M105644</link>
      <description>&lt;P&gt;I'm currently using the Apprentice Viewer to view Inventor files in my C# application. Is there any way to change the viewer background colour from blue to white?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 20:25:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9308407#M105644</guid>
      <dc:creator>ianjwellings</dc:creator>
      <dc:date>2020-02-10T20:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Apprentice Viewer Background Colour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9308442#M105647</link>
      <description>&lt;P&gt;You did not specify how you get the images, but i guess you use the camera class. Brian Ekins wrote a greate post about using the camera. &lt;A href="https://modthemachine.typepad.com/my_weblog/2013/09/working-with-cameras-part-2.html" target="_blank" rel="noopener"&gt;you can find it here.&lt;/A&gt; In that post you will find the following code. in the last lines he shows how to set the background color when the picture is saved.&lt;/P&gt;&lt;PRE&gt;Private Sub CreateImage( _
              Apprentice As Inventor.ApprenticeServerComponent, _
              PartOrAssembly As Inventor.ApprenticeServerDocument, _
              Filename As String)
   ' Create a new camera.
   Dim cam As Inventor.Camera
   cam = Apprentice.TransientObjects.CreateCamera

   ' Associate the document with the camera.
   cam.SceneObject = PartOrAssembly.ComponentDefinition

   ' Define the camera and apply the changes.
   cam.ViewOrientationType = _
        Inventor.ViewOrientationTypeEnum.kIsoTopRightViewOrientation
   cam.Fit()
   cam.ApplyWithoutTransition()

   ' Save the result, defining the background color of the image.
   cam.SaveAsBitmap(Filename, 800, 600, _
           &lt;FONT color="#339966"&gt;Apprentice.TransientObjects.CreateColor(255, 255, 0)&lt;/FONT&gt;, _ 
           &lt;FONT color="#339966"&gt;Apprentice.TransientObjects.CreateColor(15, 15, 15))&lt;/FONT&gt;
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 20:40:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9308442#M105647</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2020-02-10T20:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Apprentice Viewer Background Colour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9309508#M105658</link>
      <description>&lt;P&gt;Thank you for the quick response.&lt;/P&gt;&lt;P&gt;I'd like to change the background colour in the picturebox ClientView if possible? Without having to export as an image.&lt;/P&gt;&lt;P&gt;This is the code I'm using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oSvr = new Inventor.ApprenticeServerComponent();
oAppDoc = oSvr.OpenWithOptions(strFullDocumentName, oDocOpenOptions);
oClientView = oAppDoc.ClientViews.Add(pictureBox1.Handle.ToInt32());

oCamera = oClientView.Camera;
oCamera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation;
oCamera.Perspective = true;
oCamera.Apply();
this.Refresh();
oClientView.Update(false);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 09:35:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9309508#M105658</guid>
      <dc:creator>ianjwellings</dc:creator>
      <dc:date>2020-02-11T09:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Apprentice Viewer Background Colour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9310291#M105672</link>
      <description>&lt;P&gt;Thank you for the quick response.&lt;/P&gt;&lt;P&gt;I'd like to change the background colour in the picturebox ClientView if possible? Without having to export as an image.&lt;/P&gt;&lt;P&gt;This is the code I'm using:&lt;/P&gt;&lt;PRE&gt;oSvr = new Inventor.ApprenticeServerComponent();
oAppDoc = oSvr.OpenWithOptions(strFullDocumentName, oDocOpenOptions);
oClientView = oAppDoc.ClientViews.Add(pictureBox1.Handle.ToInt32());

oCamera = oClientView.Camera;
oCamera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation;
oCamera.Perspective = true;
oCamera.Apply();
this.Refresh();
oClientView.Update(false);&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 14:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/apprentice-viewer-background-colour/m-p/9310291#M105672</guid>
      <dc:creator>ianjwellings</dc:creator>
      <dc:date>2020-02-11T14:55:25Z</dc:date>
    </item>
  </channel>
</rss>

