试过了,这样也不行
taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),"\\popup\\skin.bmp"),Color.FromArgb(255,0,255));

解决方案 »

  1.   

    用绝对路径试试, 如:
       @"C:\popup\skin.bmp"
      

  2.   

    首先取应用程序根目录
    string tempImagePath = Application.StartupPath;
    然后再
    taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),tempImagePath+@"\popup\skin.bmp"),Color.FromArgb(255,0,255));
    或者:
    taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),tempImagePath+"\\popup\\skin.bmp"),Color.FromArgb(255,0,255));
      

  3.   

    在这段代码之前加上
    MessageBox.Show(Directory.GetCurrentDirectory()+@"\popup\skin.bmp");
    你就明白了。
      

  4.   

    "/popup/skin.bmp"这个明显不对嘛;用@"/popup/skin.bmp"或"//popup//skin.bmp"
      

  5.   

    以上的方法都试过了,还是不行 :(这样也不行:
    taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),Application.StartupPath+@"\popup\skin.bmp"),Color.FromArgb(255,0,255));提示错误:无法在类“TaskbarNotifierDemo.Form1”中找到资源“D:\11\A8C#实现一种超酷的任务栏滑出式提醒框\bin\Debug\popup\skin.bmp”。而skin.bmp文件是确实存在的。
      

  6.   

    打印一下Application.StartupPath+@"\popup\skin.bmp这个路径字符串到底是什么。
      

  7.   

    是这个:
    D:\11\A8C#实现一种超酷的任务栏滑出式提醒框\bin\Debug\popup\skin.bmp
      

  8.   

    new Bitmap(Application.StartupPath+@"\popup\skin.bmp")
      

  9.   

    把路径改成English试试    我也老范这样的错误
      

  10.   

    我将文件打包上传了,哪位高手帮看一下,能运行就行。http://pickup.mofile.com/3185988372859383 
      

  11.   

    http://pickup.mofile.com/3185988372859383 
      

  12.   

    我将文件打包上传了,哪位高手帮看一下,能运行就行。 http://pickup.mofile.com/3185988372859383 
      

  13.   

    出现错误“无法在类“TaskbarNotifierDemo.Form1”中找到资源“/popup/skin.bmp”。”
    -----------------------------------------------------------------------------
    路径再对,如果skin.bmp不是工程的资源,同样找不到。双击你的资源文件,打开看看。
      

  14.   

    引用 Resources 空间直接 Resources.你得图片就哦了
      

  15.   


    可以通过: Properties.Resources.skin 来获得你添加的图片
      

  16.   


    //相对路径
    taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),"..\\popup\\skin.bmp"),Color.FromArgb(255,0,255));
      

  17.   

    能否说得详细一点,是这样吗?taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "Properties.Resources.skin"), Color.FromArgb(255, 0, 255));可是运行还是通不过 :(
      

  18.   

    既然已经定义为了资源文件, 那么就不需要直接使用路径了, 在Resources.Designer.cs中有此图片的引用, 可以直接使用
      

  19.   

    taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "Properties.Resources.skin"), Color.FromArgb(255, 0, 255));
    -------------------------------------------------------------------------
    额。。Properties.Resources.skin就是你添加的图片,不是路径。
    如:Graphice.DrawImage(Properties.Resources.skin,0,0,100,100);//它是对象,不是路径。
      

  20.   

    这是一个很简单的问题,
    关键在于,楼主你没有理解这程序的真正意思,
    就是你没有真正的消化吸收别人的东西为自已的,只是照抄.
    给你两种方法,都可以使这句正常运行.
    第一种,在项目资源里,加入你要用的图片,然后这样写.
    taskbarNotifier1.SetBackgroundBitmap(TaskbarNotifierDemo.Properties.Resources.skin,Color.FromArgb(255,0,255)); 第二种,或直接用地址,在你的BIN目录下,把你要用的图片拷进去.
    然后这样写.taskbarNotifier1.SetBackgroundBitmap(new Bitmap(Application.StartupPath + "\\skin.bmp",false),Color.FromArgb(255,0,255)); 
      

  21.   

    借鉴用7楼方法
    注意:
    1)将图片放在debug文件夹下,因为tempImagePath的值是:C:\...\TTT\bin\Debug
    2)把taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),"/popup/skin.bmp"),Color.FromArgb(255,0,255));改为 
    taskbarNotifier2.SetBackgroundBitmap(new Bitmap(tempImagePath+ "\\skin2.bmp"), Color.FromArgb(255, 0, 255));
    我这可以运行