我正在尝试以下列方式设置面板的背景图像
Dim bmp As New Bitmap(1500, 2500)
Dim g As Graphics = System.Drawing.Graphics.FromImage(bmp)
DrawTimeScale(g)
g.Flush()
Dim img_converter As New ImageConverter()
Dim bytes As Byte() = DirectCast(img_converter.ConvertTo(bmp, GetType(Byte())), Byte())
File.WriteAllBytes(Server.MapPath("~/Images/OT.jpeg"), bytes)
pnl001.BackColor = Color.White
pnl001.BackImageUrl = "~/Images/OT.jpeg"
pnl001.Attributes.Add("style", "background-repeat:no-repeat")
但是正如代码所示,我每次都需要在服务器中显示图像..如何直接将 bmp 设置为背景图像..因为它可能会在服务器上部署时产生问题