본문 바로가기

Application179

rxrichedit 컨트롤 String 으로 저장 procedure TForm1.Button1Click(Sender: TObject); var Stream : TMemoryStream; Str : String; begin Stream := TMemoryStream.Create; RxRichEdit1.Lines.SaveToStream(Stream); Stream.Position := 0; Memo1.Lines.LoadFromStream(Stream); Stream.Free; Str := Memo1.Text; //RxRichEdit1.Lines.SaveToStream .SaveToFile('d:\aaa.rtf'); showmessage(str); end; 2008. 8. 13.
bmp, jpeg 상호 변환 procedure TMainForm.BMP2JPG(JPGFile: String; BMPFile: String); var Bmp: TBitmap; Jpg : TjpegImage; begin Bmp := TBitmap.Create; Jpg := TjpegImage.Create; Bmp.LoadFromFile(BMPFile); Jpg.Assign(Bmp); Jpg.SaveToFile(JPGFile); Bmp.Free; Jpg.Free; end; procedure TMainForm.JPG2BMP(BMPFile: String; JPGFile: String); var Bmp: TBitmap; Jpg : TjpegImage; begin Bmp := TBitmap.Create; Jpg := TjpegImage.Crea.. 2008. 8. 13.
rxrichedit 이미지나 문자 넣기. function ConvertBitmapToRTF(const Bitmap: TBitmap): string; var bi, bb: string; bis, bbs: Cardinal; achar: string[2]; Buffer: string; I: Integer; type PWord = ^Word; begin GetDIBSizes(Bitmap.Handle, bis, bbs); SetLength(bi, bis); SetLength(bb, bbs); GetDIB(Bitmap.Handle, Bitmap.Palette, PChar(bi)^, PChar(bb)^); SetLength(Buffer, (Length(bb) + Length(bi)) * 2); i := 1; for bis := 1 to Length(bi) .. 2008. 8. 13.
rxrichedit 이미지 삽입 function BitmapToRtf(graph:TBitmap):string; var bi, bb, rtf:string; bis, bbs:cardinal; achar:ShortString; HexGraph:string; I:Integer; begin GetDIBSizes(graph.Handle, bis, bbs); SetLength(bi,bis); SetLength(bb,bbs); GetDIB(graph.Handle, graph.Palette, PChar(bi)^, PChar(bb)^); rtf:='{\rtf1 {\pict\dibitmap '; SetLength(HexGraph,(Length(bb) + Length(bi)) * 2); I:=2; for bis:=1 to Length(bi) do begin.. 2008. 8. 13.