B4J Question Return canvas (already drawn on) from a B4J code module

Johan Schoeman

Expert
Licensed User
Longtime User
I need some advise please:

1. I have a layout called "main"
2. There are 7 canvas objects on this layout.
3. I have successfully drawn on 6 of them with code residing in the main module of the project
4. I have a code module inside the B4J project and declared/defined a canvas object inside this code module
5. The code inside the code module draws on the declared/defined canvas
6. The code module returns a canvas object (i.e the canvas that I have drawn on with the code inside the code module)
6. I then try to set Canvas7 in the main layout equal to the canvas object that was returned from the code module. But Canvas7 stays blank....

This is the call to the code module from the main module
Canvas7 = PDF417.Draw_PDF417_Code(msg,1,5)

and this is the sub in the code module
Public Sub Draw_PDF417_Code (message As String, err_lvl As Int, no_of_data_columns As Int) As Canvas

No error during code compilation or execution but Canvas 7 remains blank as if the canvas returned from the code module is blank. Is there a way to visually see what has been done to the canvas object that was declared inside the code module? Or should this code reside in a class module rather than a code module?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Erel, Canvas7 in the main module was added via the designer. But the canvas declared in the code module was not added to the form. It thus resides in"memory" only and I am trying to return it to the main module and let Canvas7 then displays it. Should I add the canvas that I declare in the code module to the form with code in the code module?
 
Upvote 0
Top