1

I have the following code in ActiveReports 12 in the Designer.vb file. I'm manually upgrading to ActiveReports 16 (because choosing the upgrade option from the Visual Studio menu isn't working) and need to convert all instances of GrapeCity.ActiveReports.SectionReportModel.Picture controls in my reporting files to use ImageBytes instead of ImageData.

The below is valid syntax but does not display the image in the Designer GUI. Any suggestions? Me.Picture1.ImageBytes = CType(resources.GetObject("Picture1.ImageData"), Byte())

Resources is defined in my InitializeComponent() Sub as:

Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ReportFile))

The Picture control is defined in the Designer.vb as follows:

    '
    'Picture1
    '
    Me.Picture1.Height = 0.94!
    Me.Picture1.ImageData = CType(resources.GetObject("Picture1.ImageData"), System.IO.Stream)
    Me.Picture1.Left = 0.0!
    Me.Picture1.LineColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
    Me.Picture1.Name = "Picture1"
    Me.Picture1.SizeMode = GrapeCity.ActiveReports.SectionReportModel.SizeModes.Stretch
    Me.Picture1.Top = 0.0!
    Me.Picture1.Width = 7.94!
thecoolmacdude
  • 2,036
  • 1
  • 23
  • 38

1 Answers1

0

'Me.Picture.ImageData = CType(resources.GetObject("Picture.ImageData"), System.IO.b) Me.Picture.ImageBytes = CType(resources.GetObject("Picture.ImageData"), Byte())

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 18 '23 at 12:05