整个核心的主文件是ELT_Main,ELT_Extra是几个非类的函数,ELT_Windows目前只含有一个获取Windows下字体的函数,核心文件中没有使用,放入其中只是为了方便。 目前还不知道安卓下获取已安装字体的方法。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
要支持RTF格式的话…… 玄虚现在还没有研究RTF格式的协议,不过大致看了看,应该不成问题,只是需要研究研究,毕竟简单的网页生成也做出来了。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
这个结构我不知道想了多久才设计出,但是这样就意味着不方便设计背景图片了,因为每一次重绘都是按照段落的,生成的是bmp。 我在FMX下没找到背景透明的png类,或许是有?
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
谢谢关于撤销重做的指点,我现在有了思路,等思路清晰了就开始动手。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, IInterface(ClipService)) then try s := ClipService.GetClipboard.ToString; finally end;
并没有找到如何把格式带进粘贴板中。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
这是一个系统定义的函数吗?需要引用哪个单元呢? 我这里显示没有定义这个函数诶。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.
type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; RichEdit1: TRichEdit; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
var CF_RTF: Word = 0;
procedure RTFtoClipboard(txt: string; rtf: Ansistring); var Data: Cardinal; begin with Clipboard do begin Data := GlobalAlloc(GHND or GMEM_SHARE, Length(rtf)*SizeOf(Char) + 1); if Data <> 0 then try StrPCopy(GlobalLock(Data), rtf); GlobalUnlock(Data); Open; try AsText := txt; SetAsHandle(CF_RTF, Data); finally Close; end; except GlobalFree(Data); ShowMessage('Unable to copy the selected RTF text'); end else ShowMessage('Global Alloc failed during Copy to Clipboard!'); end; end;
procedure TForm1.Button1Click(Sender: TObject); var txt: string; rtf: string; ss: TStringStream; begin txt := Self.RichEdit1.Text; ss := TStringStream.Create(''); try Self.RichEdit1.Lines.SaveToStream(ss); rtf := ss.DataString; finally ss.Free; end; RTFtoClipboard(txt, rtf); end;
procedure TForm1.Button2Click(Sender: TObject); var rtf: Ansistring; begin Clipboard.Open; try if Clipboard.HasFormat(CF_RTF) then begin rtf := StrPas(PAnsiChar(GlobalLock(Clipboard.GetAsHandle(CF_RTF)))); Memo1.Lines.Add(rtf); end else begin ShowMessage('The clipboard does not contain RTF text!'); end; finally Clipboard.Close; end; end;
谢谢楼上的肯定,不过还是过誉了吧。哪里达到了WPS这个程度啊。
----------------------------------------------
--O, ye Magnificient Deity's Miracle! --I'm yet Reniastyc de El Magnifico.