小编pik*_*zen的帖子

在WPF图像控件上设置背景图像?

我正在尝试在WPF中的图像控件上有一个背景图像,例如,如果我加载一个透明的PNG,我仍然可以看到背景.是否可能,或者微软完全放弃了WPF的这个功能,我必须依靠StackPanels/Grids /无论如何实现这一目标?

c# wpf controls background image

5
推荐指数
2
解决办法
3万
查看次数

在参数中添加尾部斜杠(/)

我正在我的计算机上注册一个自定义协议处理程序,它调用此应用程序:

        string prefix = "runapp://";

        // The name of this app for user messages
        string title = "RunApp URL Protocol Handler";

        // Verify the command line arguments
        if (args.Length == 0 || !args[0].StartsWith(prefix))
        { 
            MessageBox.Show("Syntax:\nrunapp://<key>", title); return; 
        }

        string key = args[0].Remove(0, "runapp://".Length);
        key.TrimEnd('/'); 

        string application = "";
        string parameters = "";
        string applicationDirectory = "";

        if (key.Contains("~"))
        {
            application = key.Split('~')[0];
            parameters = key.Split('~')[1];
        }
        else
        {
            application = key;
        }


        applicationDirectory = Directory.GetParent(application).FullName;

        ProcessStartInfo psInfo = new ProcessStartInfo(); …
Run Code Online (Sandbox Code Playgroud)

c# protocols url-protocol

3
推荐指数
1
解决办法
1700
查看次数

标签 统计

c# ×2

background ×1

controls ×1

image ×1

protocols ×1

url-protocol ×1

wpf ×1