| 个人资料Phil Zhang's Thinking Sp...照片日志列表 | 帮助 |
|
2005/11/14 It's so wired...在水木上看到一篇文章说MicroSoft竟然允许英国一家公司收购和贩卖二手许可证,这个事情太奇怪了!
目前软件贸易的规则的发起者是Microsoft的founder Bill Gates,而现在这种买2手许可证的做法在软件业务上怎么可行呢?
软件许可意味着部分服务,是否二手软件许可证的意思就是服务可以打折?太奇怪了!
想不通ing.... 2005/10/9 莫名奇妙奇怪!
今天早上来到公司,就看到水水的桌子上有一本新的《程序员》杂志,上书曰:程序员杂志5年。
莫名奇妙之余,想到了自己的年龄,唉,也的确有5年了。看杂志里面5年的月刊的模样,就想到了看这些杂志的情景,想想自己这5年来的经历,也值得唏嘘一下。
想想最早见老蒋的时候,他还没有开始做美达美,后来做光盘,然后做网站,最后做杂志。我觉得老蒋是我认识的这一圈程序员朋友里面做事情最扎实的。是上个月(?)和老蒋喝酒答谢老蒋收留我的大学同学,他说起他最近做的事情,我觉得老蒋变了,没有那么睿智多变,也平和了,也开始打太极拳开始养生了。其实我觉得这样做挺危险的,这只是一种感觉。 2005/9/22 insert a bitmap to TRichEdit in Delpicopy &. paste from Delphi3000.com
Question/Problem/Abstract: | How do I insert a picture into an enhanced RichEdit control (i.e. RxRichEdit, RichEditEx, RichEdit98, and Microsoft RichTextBox control) without using the clipboard or OLE? Answer: | After quite a bit of searching the net, I found that there was no easy way to insert an image into a RichEdit. Inserting a bitmap as an object worked well enough, but the user can still open it up and edit it, and the image had to be an existing file. Using the clipboard worked even better, but wiped out the previous contents. Since my project required that the image was both reasonably uneditable, and left the clipboard intact, I had to resort to editing the RTF. If you have Rxlib, or use the Microsoft RichTextBox control (comes with VB5+), this may be of some use to you. Please forgive the sloppiness. Any suggestions on how to optimize it would be greatly appreciated, since loading larger images causes a delay I would rather do without. function BitmapToRTF(pict: TBitmap): string; var bi,bb,rtf: string; bis,bbs: Cardinal; achar: ShortString; hexpict: string; I: Integer; begin GetDIBSizes(pict.Handle,bis,bbs); SetLength(bi,bis); SetLength(bb,bbs); GetDIB(pict.Handle,pict.Palette,PChar(bi)^,PChar(bb)^); rtf := '{\rtf1 {\pict\dibitmap '; SetLength(hexpict,(Length(bb) + Length(bi)) * 2); I := 2; for bis := 1 to Length(bi) do begin achar := Format('%x',[Integer(bi[bis])]); if Length(achar) = 1 then achar := '0' + achar; hexpict[I-1] := achar[1]; hexpict[I] := achar[2]; Inc(I,2); end; for bbs := 1 to Length(bb) do begin achar := Format('%x',[Integer(bb[bbs])]); if Length(achar) = 1 then achar := '0' + achar; hexpict[I-1] := achar[1]; hexpict[I] := achar[2]; Inc(I,2); end; rtf := rtf + hexpict + ' }}'; Result := rtf; end; This function returns a snippet of RTF code that can be streamed into an RxRichEdit or RichTextBox selection. This seems to work well for me: {assume SS is a TStringStream, RE is a TRxRichEdit and BMP is a TBitmap containing a picture.} SS := TStringStream.Create(BitmapToRTF(BMP)); RE.PlainText := False; RE.StreamMode := [smSelection]; RE.Lines.LoadFromStream(SS); SS.Free; If you don't know what RxRichEdit is, and want to know, you can get it here: http://www.rxlib.com/ If you don't know what RTF (RichText Format) is, you can read a little about it here: http://chesworth.com/pv/file_format/rtf.txt {Edit: New version of the function seems to run alot faster.} 2005/9/19 律考终于完了,真累…… 考试的不是我,是我爱人,她去年359落榜,今年再战。 去年我觉得都怪我,卷1只打了70多分,明显不是自己的水平。都是因为第一天考试没有找对考场。今年我专门在考试前一天请假和她一起去看考场,勘查线路,决定怎么去,什么时间,路线等等。 今年老婆复习得并不太好,她的主管律师不给假,只给了3周的考试假,而且复习的效率也比较低,但是我觉得她应该没问题的,只要今年正常发挥应该就没有问题了。 卷1还可以,不是狠满意 卷2还可以,不是狠满意 卷3出来就说今年折了 卷4出来告诉我今年真是够呛了 我也不知道怎么回事。 其实法律考试不仅仅考的是法律工作者,或者有志于法律工作的人们,还有他们的家属。唉,累。。。。 |
|||||||||||||||
|
|