<?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: How to dynamically load a picture in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245070#M5417</link>
    <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
you can use GX::Image to dynamically load pictures from file. &lt;BR /&gt;
 
&lt;PRE&gt;// Example code to dynamic load image: 
 
IO::Location locationToPic ("&amp;lt;path string to the picture file&amp;gt;"); 
const void* dgPicture = GX::Image (locationToPic).ToDGPicture (); 
DGSetItemImage (&amp;lt;DIALOG_ID&amp;gt;, &amp;lt;PIC_ITEM_ID&amp;gt;, DG::Picture (dgPicture));  
// or with C++ interface DG::PictureItem use SetPicture (DG::Picture (dgPicture))&lt;/PRE&gt; 
&lt;PRE&gt;// In the dialog's resource you must define a Picture item and should define a default picture in the fix GRC 
 
'GBMP'	&amp;lt;DEFAULT_PIC_RESID&amp;gt;	"default_picture" { 
	"default_picture" 
} 
 
'GDLG'  &amp;lt;DIALOG_ID&amp;gt;    Modal    0    0  210  210  "Dialog with picture" { 
/* [&amp;lt;PIC_ITEM_ID&amp;gt;] */ Picture			  10   10   200   200  &amp;lt;DEFAULT_PIC_RESID&amp;gt;	ClientEdge 
/* [          ...] */  
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Best Regards, &lt;BR /&gt;
Tibor</description>
    <pubDate>Wed, 11 Feb 2015 09:37:22 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2015-02-11T09:37:22Z</dc:date>
    <item>
      <title>[SOLVED] How to dynamically load a picture</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245069#M5416</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I need to have a picture in my add-on dialog.&lt;BR /&gt;Is there a way to dynamically load pictures from file system.&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:40:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245069#M5416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically load a picture</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245070#M5417</link>
      <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
you can use GX::Image to dynamically load pictures from file. &lt;BR /&gt;
 
&lt;PRE&gt;// Example code to dynamic load image: 
 
IO::Location locationToPic ("&amp;lt;path string to the picture file&amp;gt;"); 
const void* dgPicture = GX::Image (locationToPic).ToDGPicture (); 
DGSetItemImage (&amp;lt;DIALOG_ID&amp;gt;, &amp;lt;PIC_ITEM_ID&amp;gt;, DG::Picture (dgPicture));  
// or with C++ interface DG::PictureItem use SetPicture (DG::Picture (dgPicture))&lt;/PRE&gt; 
&lt;PRE&gt;// In the dialog's resource you must define a Picture item and should define a default picture in the fix GRC 
 
'GBMP'	&amp;lt;DEFAULT_PIC_RESID&amp;gt;	"default_picture" { 
	"default_picture" 
} 
 
'GDLG'  &amp;lt;DIALOG_ID&amp;gt;    Modal    0    0  210  210  "Dialog with picture" { 
/* [&amp;lt;PIC_ITEM_ID&amp;gt;] */ Picture			  10   10   200   200  &amp;lt;DEFAULT_PIC_RESID&amp;gt;	ClientEdge 
/* [          ...] */  
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Best Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Wed, 11 Feb 2015 09:37:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245070#M5417</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-02-11T09:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically load a picture</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245071#M5418</link>
      <description>Thank you for the answer Tibor.&lt;BR /&gt;
This is what I needed!</description>
      <pubDate>Thu, 12 Feb 2015 07:14:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-dynamically-load-a-picture/m-p/245071#M5418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-12T07:14:50Z</dc:date>
    </item>
  </channel>
</rss>

