Picture boxes or canvas tools in Dialogs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-28
04:31 PM
- last edited on
‎2021-09-14
09:31 AM
by
Noemi Balogh
Which part of the API Reference I need to read about picture boxes?
Is there any "canvas" like elements for Archicad?
I really need a picture container or an canvas container where I can display and interact a .PNG, or a .SVG file.
After some user input is made, the AddOn will create a query on a database(online) which will result in an image, after that i need to update that image and so on ...
Is there any possibility to actually draw on the Dialog box?
I attached a picture where I would like to have a picture box or a canvas element so you can have an ideea. .
A C# example:
Solved! Go to Solution.
- Labels:
-
Add-On (C++)
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 07:56 AM
1. Define a user item in the grc:
/* [ 1] */ UserItem 100 100 50 50 ClientEdge
2. Initialize it in the dialog constructor:
myUserItem (GetReference (), MyUserItemID)
3. Attach to event listener.
4. Implement the UserItemUpdate function.
void MyDialog::UserItemUpdate (const DG::UserItemUpdateEvent& ev) { NewDisplay::UserItemUpdateNativeContext context (ev); // ... context.DrawImage (image, width, height, 0.0f, 0.0f, 0.0f, false); // ... }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-28 06:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-28 11:39 PM
Can you point me where I can find some documentation/help on DG::UserItem?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 07:56 AM
1. Define a user item in the grc:
/* [ 1] */ UserItem 100 100 50 50 ClientEdge
2. Initialize it in the dialog constructor:
myUserItem (GetReference (), MyUserItemID)
3. Attach to event listener.
4. Implement the UserItemUpdate function.
void MyDialog::UserItemUpdate (const DG::UserItemUpdateEvent& ev) { NewDisplay::UserItemUpdateNativeContext context (ev); // ... context.DrawImage (image, width, height, 0.0f, 0.0f, 0.0f, false); // ... }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 09:19 AM

I was thinking about buying the Developer Support for a year. Where can I find some information about the services included in this subscription from GRAPHISOFT?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 09:57 AM
Viktor wrote:If someone arrives to this post and does not know where the UserItemUpdateNativeContext is located it is here: AC_DEV_KIT_PATH\Support\Modules\DGGraphix
Unfortunately there is no easy example among the example add-ons, but here are the basics.
void MyDialog::UserItemUpdate (const DG::UserItemUpdateEvent& ev) { NewDisplay::UserItemUpdateNativeContext context (ev); // ... context.DrawImage (image, width, height, 0.0f, 0.0f, 0.0f, false); // ... }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 11:19 AM
Mihalcea wrote:Hi Michalcea,
I was thinking about buying the Developer Support for a year. Where can I find some information about the services included in this subscription from GRAPHISOFT?
The subscription includes a "priority lane" via the official support channel
Best, Akos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 01:16 PM
I will think about this service!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-29 05:16 PM
Viktor wrote:This code works only inside the "UserItemUpdate" function when the UserItem updates. I am having a real hard time figuring out how to pass this context to a function like
void MyDialog::UserItemUpdate (const DG::UserItemUpdateEvent& ev) { NewDisplay::UserItemUpdateNativeContext context (ev); // ... context.DrawImage (image, width, height, 0.0f, 0.0f, 0.0f, false); // ... }
virtual void UserItemClicked(const DGUserItemClickEvent &ev) { //draw something when user clicks } virtual void SpecDragStarting(const ItemDragSourceEvent &ev) { //do something when user starts dragging like fetch an image from Google Earth based on the new coordinates }I tried to reference it, but obviously I get Memory Access Exception.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-06-30 06:49 AM