private void DrawStuff()
{
//
//if (buffer == null)
//{
// buffer = new RenderTargetBitmap((int)Background.Width, (int)Background.Height, 96, 96, PixelFormats.Pbgra32);
// Background.Source = buffer;
// return;
//}
//using (DrawingContext drawingContext = drawingVisual.RenderOpen())
//{
// drawingContext.DrawRectangle(new SolidColorBrush(Colors.Red), null, new Rect(0, 0, 10, 10));
//}
//buffer.Render(drawingVisual);
} private void DrawImage() {
//
// layoutDocumentMapContainer
//if (dockPanelMapContainer.ActualWidth <1 || dockPanelMapContainer.ActualHeight < 1 || this.Background == null)
//{
// return;
//}
//using (Bitmap bitmap = new Bitmap((int)dockPanelMapContainer.ActualWidth, (int)dockPanelMapContainer.ActualHeight))
//{
// this.Background.Visibility = Visibility.Visible;
// this.Background.Width = (double)bitmap.Width;
// this.Background.Height = (double)bitmap.Height;
// Graphics graphics = Graphics.FromImage(bitmap);
// graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Blue), new RectangleF(0, 0, (float)(dockPanelMapContainer.ActualWidth - 0), (float)(dockPanelMapContainer.ActualHeight - 0)));
// MemoryStream memoryStream = new MemoryStream();
// bitmap.Save(memoryStream, ImageFormat.Png);
// memoryStream.Position = 0L;
// BitmapImage bitmapImage = new BitmapImage();
// bitmapImage.BeginInit();
// bitmapImage.StreamSource = memoryStream;
// bitmapImage.EndInit();
// this.Background.Source = bitmapImage;
// graphics.Dispose();
// graphics = null;
//}
}

WPF中绘图(含调用GDI+)的更多相关文章

  1. C#调用GDI+1.1中的函数实现高斯模糊、USM锐化等经典效果。

    http://www.cnblogs.com/Imageshop/archive/2012/12/13/2815712.html 在GDI+1.1的版本中,MS加入不少新的特性,其中的特效类Effec ...

  2. WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常

    WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常 在wpf中封装Com组件时,调用组件 ...

  3. 在WPF中调用Winform控件

    最近在项目中用到了人脸识别和指纹识别,需要调用外部设备和接口,这里就用到了在WPF中调用Winform控件. 第一步,添加程序集引用.System.Windows.Forms和WindowsForms ...

  4. WPF中窗口控件的跨线程调用

    在WinForm中,我们要跨线程访问窗口控件,只需要设置属性CheckForIllegalCrossThreadCalls = false;即可. 在WPF中要麻烦一下,同样的不允许跨线程访问,因为没 ...

  5. WPF在Canvas中绘图实现折线统计图

    最近在WPF中做一个需要实现统计的功能,其中需要用到统计图,之前也没有接触过,度娘上大多都是各种收费或者免费的第三方控件,不想用第三方控件那就自己画一个吧. 在园子还找到一篇文章,思路来自这篇文章,文 ...

  6. WPF 在绘图控件(Shape)中添加文字 [2018.7.15]

    原文:WPF 在绘图控件(Shape)中添加文字 [2018.7.15] Q:使用Shape的子类Ellipse画一个圆,如何在圆中添加文字? A:Shape类中不包含Text属性.可使用Shape类 ...

  7. GDI+与WPF中的颜色简析

    原文:GDI+与WPF中的颜色简析 --------------------------------------------------------------------------------引用 ...

  8. WPF中如何使用图像API进行绘制

    首先,由于WPF中不象GDI+中有Graphics对象,因此你无法使用Graphics进行绘图了,取而代之的是:DrawingContext:类似地,GDI+中的OnPaint已被OnRender取代 ...

  9. WPF中使用amCharts绘制股票K线图

    原文:WPF中使用amCharts绘制股票K线图 本想自己用GDI绘图, 通过数据直接绘制一张蜡柱图, 但觉得这样子的功能比较少, 所以到网上搜索一些能画出K线图的控件. 发现DynamicDataD ...

随机推荐

  1. 使用dapper遇到的问题及解决方法

    在使用dapper进行数据查询时遇到的一个问题,今天进行问题重现做一个记录,免得忘记以后又犯同样的错误. 自己要实现的是:select * from tablename where id in(1,2 ...

  2. LinkedHashMap,源码解读就是这么简单

    概述 LinkedHashMap是HashMap的子类,它的大部分实现与HashMap相同,两者最大的区别在于,HashMap的对哈希表进行迭代时是无序的,而LinkedHashMap对哈希表迭代是有 ...

  3. SPA项目搭建及嵌套路由

    Vue-cli: 什么是vue-cli? vue-cli是vue.js的脚手架,用于自动生成vue.js+webpack的项目模板,创建命令如下: vue init webpack xxx 注1:xx ...

  4. Gradle task简单使用

    还望支持个人博客站:http://www.enjoytoday.cn task是什么 task是gradle构建脚本的最小运行单元,我们通过在gradle脚本中创建task任务,以期完成某个特定的功能 ...

  5. MySQL基础之数据管理【3】

    MySQL中的多表联查 --查询emp的id username age depName create table emp( id int unsigned auto_increment key, us ...

  6. 传入一个Map<String,Long> 返回它按value排序后的结果

    //传入一个Map<String,Long> 返回它按value排序后的结果 sort为正序还是倒序(-1倒序),size为要几条数据 private static Map<Stri ...

  7. centos7中python3.6报错ModuleNotFoundError: No module named '_ssl' 或者 Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",))

    如果在运行爬虫时报此错:requests.exceptions.SSLError: HTTPSConnectionPool(host='www.baidu.com', port=443): Max r ...

  8. CodeForces - 1251C (思维+贪心+归并排序)

    题意 https://vjudge.net/problem/CodeForces-1251C 一个字符串,相邻的偶数奇数不能交换位置,其他相邻的情况可以交换,问字符串代表的数最小是多少. 思路 相邻的 ...

  9. Java面试题-基础篇一(干货篇)

    1.一个".java"源文件中是否可以包括多个类(不是内部类)?有什么限制? 可以有多个类,但只能有一个public的类,并且public的类名必须与文件名相一致. 2.Java有 ...

  10. 往对象数组里面添加相同的key 不同的value 和删除相同的key值

    应用场景:后盾字段没有发给你  自己补充数据 <div v-for="item in list" :key="item.id"> <p> ...