c# - 加载到富文本框中时,富文本文件中的 C# 图像不居中
问题描述
我在 OpenOffice Writer 中创建了一个富文本文件,其中包含一个居中对齐的图像,并尝试将文件加载到我的 C# WinForms 应用程序中的富文本框中。问题是图像左对齐而不是居中。这是我的代码:
private void DisplayStartPage()
{
rtbMain.ReadOnly = false;
using (MemoryStream ms = new MemoryStream(OurProject.MainPage.StartPageContent, 0, OurProject.MainPage.StartPageContent.Length))
{
ms.Write(OurProject.MainPage.StartPageContent, 0, OurProject.MainPage.StartPageContent.Length);
ms.Position = 0;
rtbMain.LoadFile(ms, RichTextBoxStreamType.RichText);
}
rtbMain.ReadOnly = true;
}
这个问题是由上面的代码引起的,还是我用来创建富文本文件的应用程序?
解决方案
推荐阅读
- mysql-8.0 - 如何修复 ERROR 1726 (HY000):存储引擎“MyISAM”不支持系统表。在 CREATE USER 之后的 Mysql 8.0
- python - Scrapy-Splash 请求的 URL 与真实 URL
- firebase - 在没有 Android 项目的情况下,无法在 Unity 中的 iOS 上初始化 firebase
- python - 从随机排序的列表创建数组掩码
- python - Python 的 argparse 显示子命令参数的默认值
- python - Python3 - 以正确的方式格式化 csv 输出
- node.js - 如何使用 Express.js 设置自定义主机名和删除端口?
- openssl - 以下 tr34 asn.1 消息中使用什么数据来生成签名?
- design-patterns - 为所有微服务取消一个桶是微服务架构中的反模式
- python - 将 pandas 数据帧转换为结构化 numpy 数组的便捷函数是什么样的?