高分请教一个文件保存的问题!

zsuivon 2004-05-02 11:15:29
大家好,请问如何将RichEdit中的内容保存为一个bmp文件。
最好是不要用光栅的方法。好像可以用二进制转换的方法,但我不会用。
有没有高手指教,谢谢!
...全文
27 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zsuivon 2004-05-09
  • 打赏
  • 举报
回复
怎么还没有人回答啊?
zsuivon 2004-05-09
  • 打赏
  • 举报
回复
可是这样保存还是有光栅啊
有没有更好的办法,谢谢!
zxcdewq 2004-05-09
  • 打赏
  • 举报
回复

void __fastcall TForm1::Button1Click(TObject *Sender)
{
TRect rectS, rectD;

rectS.top = RichEdit1->Top;
rectS.left = RichEdit1->Left;
rectS.Bottom = RichEdit1->Top + RichEdit1->Height;
rectS.right = RichEdit1->Left + RichEdit1->Width;

rectD.top = 0;
rectD.left = 0;
rectD.Bottom = RichEdit1->Height;
rectD.right = RichEdit1->Width;


Graphics::TBitmap *b = new Graphics::TBitmap;

b->Width = RichEdit1->Width;
b->Height = RichEdit1->Height;

b->Canvas->CopyRect(rectD, Form1->Canvas, rectS);

b->SaveToFile("c:\\a.bmp");


}
zxcdewq 2004-05-09
  • 打赏
  • 举报
回复
得到区域然后CopyRect然后保存为bmp可以么

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧