首页 > 系统相关 >C# Console application start wpf window via Application, Encapsulates a Windows Presentation Foundat

C# Console application start wpf window via Application, Encapsulates a Windows Presentation Foundat

时间:2024-09-10 21:49:13浏览次数:1  
标签:Foundation via Windows win System application bmp using

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace ConsoleApp73
{
    internal class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Encapsulates a Windows Presentation Foundation (WPF) application.");
            Application app = new Application();
            Window win = new Window();
            win.Title = "New WPF window from console application!";
            Image img = new Image();
            BitmapImage bmp = new BitmapImage();
            bmp.BeginInit();
            bmp.UriSource = new Uri(@"..\..\Image\1.jpg",UriKind.RelativeOrAbsolute);
            bmp.EndInit();
            bmp.Freeze();
            img.Source = bmp;
            win.Content = img;
            win.Show();
            app.Run(win);
            Console.ReadLine();
        }
    }
}

 

 

 

标签:Foundation,via,Windows,win,System,application,bmp,using
From: https://www.cnblogs.com/Fred1987/p/18407278

相关文章

  • C# console application main method new and start wpf window application
    1.NewConsoleapplication;2.Addreference,PresentationCoreandWindowsBase3.usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows;usingSystem.Windows.Controls;using......
  • 论文笔记--See through Gradients. Image Batch Recovery via GradInversion
    SeethroughGradients.ImageBatchRecoveryviaGradInversion\(W^{FC}\in\mathbb{R}^{M\timesN}\),其输入为一个M维向量\(v\in\mathbb{R}^M\),\(\DeltaW^{FC}_{m,n,k}\)是损失函数对全连接层\(W\)的导数。对于一个特定的类别\(n\),(\(z\)为全连接层输出的logits),其......
  • comp10002 Foundations of Algorithms
    SchoolofComputing andInformationSystemscomp10002 Foundations of AlgorithmsSemester 2,2024Assignment 1LearningOutcomesIn this assignment you will demonstrate your understanding of arrays,  strings, functions, and the typedeffac......
  • Applications of UDTL to Intelligent Fault Diagnosis: A Survey and Comparative St
    文章目录摘要一、引言二、背景和定义A.UDTL定义B.基于UDTL的IFD分类C.基于UDTL的IFD动机D.主干结构三、LABEL-CONSISTENTUDTLA.基于网络的UDTLB.基于实例化的UDTLC.基于映射的UDTLD.基于对抗性的IFD四.LABEL-INCONSISTENTUDTLA.PartialUDTLB.OpenSetUDTLC.Uni......
  • Graph Edge Partitioning via Neighborhood Heuristic
    目录概符号说明VertexvsEdgepartitioningNE(NeighborExpansion)代码ZhangC.,WeiF.,LiuQ.,TangZ.G.andLiZ.Graphedgepartitioningvianeighborhoodheuristic.KDD,2017.概本文提出了一种图分割方法(edgepartitioning),保证只有少量的重复结点.符号......
  • A COMPREHENSIVE SURVEY ON EVALUATING LARGE LANGUAGE MODEL APPLICATIONS IN THE ME
    本文是LLM系列文章,针对《ACOMPREHENSIVESURVEYONEVALUATINGLARGELANGUAGEMODELAPPLICATIONSINTHEMEDICALINDUSTRY》的翻译。关于评估医疗行业中大型语言模型应用程序的综合调查摘要1引言和背景2综述的分类和结构3医学领域LLM应用评估的现状4挑战......
  • Designing Data-Intensive Applications
    《DesigningData-IntensiveApplications》是一本深入探讨数据密集型应用设计的书籍,由MartinKleppmann撰写。以下是对这本书的详细概述:书籍简介:作者信息:MartinKleppmann是一位在分布式系统领域的研究员,曾在LinkedIn和Rapportive等互联网公司工作,参与大规模数据基础设......
  • 手动添加Spring Boot的配置文件application.properties
      本文介绍在IntelliJIDEA软件中,为SpringBoot项目添加配置文件的操作方法。  最近,在IntelliJIDEA软件中新创建了一个SpringBoot项目,是通过如下图所示的方法直接新建的。  但是,随后发现这样创建的SpringBoot项目没有配置文件。如下图所示,其他的基本项目架构都是存在的......
  • Go - Web Application 10
    CreatingaunittestInGo,it’sstandardpracticetowriteyourtestsin*_test.gofileswhichlivedirectly alongsidethecodethatyou’retesting.So,inthiscase,thefirstthingthatwe’regoingtodo iscreateanewcmd/web/template_test.gofilet......
  • Design Patterns for Cloud Native Applications
    研究背景研究问题:本书旨在解决如何构建云原生应用的问题。云原生应用具有成本节约和可扩展性的优势,但其开发和部署面临诸多挑战。研究难点:云原生应用的复杂性在于如何在动态环境中设计和开发可扩展、可靠、可管理和可观测的应用。相关工作:本书参考了现有的架构原则和实......