I believe the following code could do what you need, otherwise I would need more information to understand what you need to do:
' inserts an image on PB display Public Sub InsertImage() Dim image As Bitmap Set image = ThisDisplay.Symbols.Add(pbSymbolBitmap) Call image.Load("C:\temp\image.png", pbImageSizing.pbImageSizingRetainAspectRatio) image.Width = 150 ' random positioning ... for demonstration only image.Left = -15000 + (Rnd * 1000) image.Top = 15000 - (Rnd * 1000) Debug.Print image.Left, image.Top End Sub
That worked fine. It is short and sweet!
I've tried something similar:
Dim image As Bitmap
Set image = New Bitmap
but whenever I use the set image = new bitmap, it has been crashing. I'm missing something but now have your streamlined approach.