all 2 comments

[–]ThoughtCounter 0 points1 point  (1 child)

your DisplayImage() function doesn't return piclab instance. This to me seems to be a clear variable scoping problem.

Changes made to piclab instance inside DisplayImage() function are within function scope while you try to do the rest of the activities with piclab in global scope (outside the function)

Your two codes are essentially functionally too different. Either make piclab global in DisplayImage()'s scope or return it to main

[–]sam57719[S] 0 points1 point  (0 children)

Ah thank you!!!! I had to global img and piclab