GetPicture and SetPicture example for Visual Basic

To use this code, you must first add a PictureBox control to your form, and make it invisible.

' Hide the LEAD control
LEADRasterView1.Visible = False
'Assign the picture object to the PictureBox control
Picture1 = LEADRasterView1.Raster.GetPicture
'Give the PictureBox control the same size and position as the LEAD control
Picture1.Top = LEADRasterView1.Top
Picture1.Left = LEADRasterView1.Left
Picture1.Height = LEADRasterView1.Height
Picture1.Width = LEADRasterView1.Width
'Interrupt with a message.
MsgBox "This is the PictureBox. Click OK for the SetPicture method"
'Get the picture object back to the LEAD control and repaint it
LEADRasterView1.AutoSetRects = False ' Keep the previous display rectangles.
LEADRasterView1.Raster.SetPicture Picture1 ' Load the bitmap from the PictureBox control.
Picture1.Visible = False ' Hide the PictureBox control.
LEADRasterView1.Visible = True ' Make the LEAD control visible.
LEADRasterView1.ForceRepaint