본문 바로가기

Application/Delphi Lecture126

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.
xml 데이타 읽기 var XMLDOM : IXMLDOMDocument; NodeList : IXMLDOMNodeList; i : Integer; begin XMLDOM := CoDomDocument.Create; try //XMLDOM.loadXML(cstr); XMLDOM.load('d:\test.xml'); NodeList := XMLDOM.selectNodes('/ExecuteList/Execute[@name="Result"]'); for i := 0 to NodeList.length - 1 do // Memo1.Lines.Add((NodeList.item[i].attributes.item[0].nodevalue); // Memo1.Lines.Add('Description = ' + (NodeList.item[i] .. 2008. 8. 13.