本文介绍了为什么没有在屏幕上绘制图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用代码在屏幕上绘制图像。但我无法弄清楚为什么它没有在屏幕上绘制。我使用以下代码,



I was using a code, to draw the image on the screen. But I am not able to figure out why it is not being drawn on the screen. I am using the following code,

Bitmap bmp = new Bitmap("10630606_727195303982470_1655175415434850365_o.jpg");
Graphics gr = Graphics.FromImage(bmp);
gr.DrawImage(bmp, 60, 30);





..如果我在代码末尾添加一个新行,如





..if I add a new line at the end of the code, as

bmp.Save("<location>");





..然后我仍然可以找到在该位置创建的文件。这意味着代码正在运行查找并且图像已加载。但图形不会在屏幕上绘制。我有一个900x700大小的WPF应用程序,但在该应用程序的屏幕上找不到图像或任何东西。



任何帮助将不胜感激。



..then I can still find out the file created at that location. Which means that the code was working find and the image was loaded. But the graphics aren't drawn on the screen. I am having a WPF application of 900x700 size but the image or any thing is not found anywhere on the screen in that application.

Any help will be appreciated.

推荐答案


这篇关于为什么没有在屏幕上绘制图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:44
查看更多