将Imagedata转换为ActiveReports中的ImageBytes 16

发布于 2025-01-29 15:17:46 字数 1189 浏览 3 评论 0原文

我在Designer.vb文件中的ActiveReports 12中有以下代码。我正在手动升级到ActiveReports 16(因为从Visual Studio菜单中选择升级选项不起作用),并且需要转换所有报告文件中的所有实例grapecity.activereports.sectionreportmodel.pictreportmodel.picture我的报告文件中的控件要使用imageBytes而不是Imagedata

以下是有效的语法,但没有在设计师GUI中显示图像。有什么建议吗? me.picture1.imagebytes = ctype(resources.getObject(“ picture1.imageData”),byte())

在我的prinitizecomponent()sub sub as:

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

resources

    '
    '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!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假扮的天使 2025-02-05 15:17:46

'me.picture.imagedata = ctype(resources.getObject(“ picture.imagedata”),system.io.b)
me.picture.imagebytes = ctype(resources.getObject(“ picture.imagedata”),byte())

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文