DLL Plugin. Static image refresh.
Dmitry from United States  [2 posts]
3 years
At analysis an example SwapColor.dll (also /Plugins/DLL/RRModule.sln) faced with problem. My actions:
1) Upload a static picture in Roborealm Open-> Choose Image Dialog
2) Run the plugin SwapColor.
3) Default is checked radio button "swap R & B"
4) Roborealm outputs the result of the exchange of values ​​between the red and blue channel.
5) Manually check radio button "swap R & G".
6) And nothing has changed.
Displays the result of the old swap "R & B", instead of a new "R & G". I guess the update image must produce the function UpdateImage, called from SwapColorDlg.cpp and determined so:

void ModuleDlg :: UpdateImage ()
  :: SendMessage (parentWnd, WM_COMMAND, IDC_UPDATE_IMAGE, 0);

Maybe somehow changed the message parameters (IDC_UPDATE_IMAGE, 0), which should take Roborealm or something else has changed? Maybe there is some other way (through code) to update the result of processing a static image?

In the case of image processing on the video stream, this feature is not evident.

Tested including SwapColor.dll, which comes bundled with Roborealm

In application to message 3 images, they are: source test image, correct swap, miss swap.

Steven from Your Country  [1376 posts] 3 years

Thanks for pointing this out. The message was not making its way to the correct function. This has been fixed with the latest version. If you download the latest RR version and run the plugin again, it should update whenever you select any of the radio buttons.

Anonymous 3 years
Excuse me, is it possible also to update source code of .. /Plugins/DLL/. The link:

Or could you tell me correct way how to update static image through code?
It would be very helpful for me.
Steven from Your Country  [1376 posts] 3 years
There is no change to that code. To update static image call


You can see example in

void SwapColorDlg::OnSwapRb()

The SwapColor DLL should now update when clicked. RoboRealm.exe was updated with fix.

Anonymous 3 years
Thank you!
You are right, everything works fine.  I hurried with the previous comment.

I also noticed, that there is memory leaks in SwapColor.dll. If at the source code to comment function bodie void SwapColorDlg :: Annotate and in function SwapColorDlg :: Process to comment SetVariable calls  (maybe I'm somewhere else commented SetVariable calls), then memory leaks disappear.

Anonymous 3 years
I forgot to mention that we are talking about the video stream.
Steven from Your Country  [1376 posts] 3 years

Thanks for mentioning that. It was a problem in the Draw.cpp file include with the SwapColor module. It was not freeing the bitmap created to draw the font/text/etc. on which was causing the memory leak.

The Plugin.zip has been updated with these changes. If you already have a modification that you were using the Draw::createDC function just update the Draw.cpp file which should now correctly free that bitmap.

No changes to RR required. That DLL has been updated in the RR download to prevent this memory leak.

If you end up using this class let us know as we may try to rearrange that bitmap creation to only happen once per module activation. Memory allocations are ideally avoided during pipeline processing as they can be quite slow ... RR is built to run memory stable, i.e. memory allocations during processing are minimized or non-existent unless the image size changes.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index