回复:面板图片 [英] Re: Panel Image

查看:82
本文介绍了回复:面板图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在表单上有一个面板.
如果在Windows XP上运行应用程序时设置面板的背景图像,则会出现以下错误.

Hi guys,

I have a panel on a form.
If I set the background image of the panel when I run my app on windows XP I get the following error.

************** Exception Text **************
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Image.get_Flags()
   at System.Windows.Forms.ControlPaint.IsImageTransparent(Image backgroundImage)
   at System.Windows.Forms.Control.set_BackgroundImageLayout(ImageLayout value)
   at TestCrashApp.frmMessage.InitializeComponent() in C:\Projects\Test Projects\TestCrashApp\TestCrashApp\frmMessage.Designer.vb:line 34
   at TestCrashApp.frmMessage..ctor()
   at TestCrashApp.Form1.Button1_Click(Object sender, EventArgs e) in C:\Projects\Test Projects\TestCrashApp\TestCrashApp\Form1.vb:line 5
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




如果我删除背景图片,它将运行正常.

该应用程序也可以在Windows 7上正常运行.

任何想法我可以做些什么来解决.

干杯们




If I remove the background image it runs fine.

The app runs fine on windows 7 also.

Any ideas what I can do to resolve this.

Cheers Guys

推荐答案

因为您没有System.Windows.Forms.PaintEventArgs
错误,我只是想知道您是否在
中设置了背景 Panel1.paint子例程?

Since you do not have a System.Windows.Forms.PaintEventArgs
error, I''m just wondering if you have set the background in a
Panel1.paint subroutine?

Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint


如果是,那么请显示一些代码,并指出错误发生的地方!


If yes, then please show some code and where the error occurs!


我的实际图像有问题,它是一个Jpeg,但我不认为XP像Jpeg一样,我将图像转换为Bitmap,现在可以正常工作了,谢谢大家的投入.
I had an issue with the actual image, it was a Jpeg, but i don''t think XP like the Jpeg, I converted the image to Bitmap, and it works fine now, thanks for the input guys.


这篇关于回复:面板图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆