找回密码
 立即注册

QQ登录

只需一步,快速开始

abcxpg

新手上路

3

主题

4

帖子

49

积分

新手上路

积分
49
  • 45

    金币

  • 主题

  • 帖子

最新发帖
abcxpg
新手上路   /  发表于:2015-2-6 13:39  /   查看:5084  /  回复:4
//增加文本框
TXTextControl.TextFrame TF = new TXTextControl.TextFrame(200, 200);
textControl1.TextFrames.Add(TF, TXTextControl.HorizontalAlignment.Left, -1, TXTextControl.TextFrameInsertionMode.DisplaceText);

//在文本框中增加图片
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
             TXTextControl.Image NewImage = new TXTextControl.Image();

             NewImage.FileName = openFileDialog1.FileName;
             NewImage.SaveMode = TXTextControl.ImageSaveMode.SaveAsData;   
    TXTextControl.TextFrame TF=textControl1.TextFrames.GetItem();   

             if(TF!=null)         
              textControl1.TextFrames.GetItem().Images.Add(NewImage, TXTextControl.HorizontalAlignment.Left, -1,
                                                     TXTextControl.ImageInsertionMode.DisplaceText);
}
//保存
textControl1.Save(TXTextControl.StreamType.All);

问题
1、在文本框中插入图片保存再加载是空白的。
2、怎么样获取文本框的坐标,想实现从其它地方拖拉一个图片到文本框中

4 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2015-2-6 16:28:00
沙发
回复 1楼abcxpg的帖子

问题已经重现了,我会反馈给厂商,有进一步结果反馈给你。
回复 使用道具 举报
abcxpg
新手上路   /  发表于:2015-2-6 19:30:00
板凳
好的,谢谢!
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-2-9 13:50:00
地板
回复 3楼abcxpg的帖子

问题已经提交给厂商,收到进一步反馈后通知你。谢谢
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-2-10 13:48:00
5#
回复 3楼abcxpg的帖子

如果需要导出 TextFrame 中的 image,需要通过以下方法:

  1.         private void addImageToolStripMenuItem_Click(object sender, EventArgs e)
  2.         {
  3.             //在文本框中增加图片
  4.             if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  5.             {
  6.                 TXTextControl.Image NewImage = new TXTextControl.Image();

  7.                 NewImage.FileName = openFileDialog1.FileName;
  8.                 NewImage.SaveMode = TXTextControl.ImageSaveMode.SaveAsFileReference;
  9.                 TXTextControl.TextFrame TF = textControl1.TextFrames.GetItem(1001);

  10.                 if (TF != null)
  11.                     TF.Images.Add(NewImage,0);
  12.             }
  13.         }
复制代码


1#方法需要通过保存为 TextControl 内置文件格式 .tx 来保存。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部