C chiu Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #1 Image1.Picture.LoadFromFile()只能装载BMP格式的文件,如何装载JPG的文件?
L lorderic Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #2 Delphi有寫了Jpeg的處理類, 只要在你的Unit的Use中加入jpeg 在TPicture.LoadFromFile方法, 就可以加載jpeg圖形;
J justcool Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #3 uses jpeg; var s:Tfilestream; pic:Tjpegimage; begin openpicturedialog1.Execute; s:= Tfilestream.Create(openpicturedialog1.filename); pic:= Tjpegimage.Create; try pic.loadfromstream(s); image1.Picture.Bitmap.Assign(pic) finally s.Free; pic.Free; end; end;
uses jpeg; var s:Tfilestream; pic:Tjpegimage; begin openpicturedialog1.Execute; s:= Tfilestream.Create(openpicturedialog1.filename); pic:= Tjpegimage.Create; try pic.loadfromstream(s); image1.Picture.Bitmap.Assign(pic) finally s.Free; pic.Free; end; end;
B bubble Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #4 哎,晚了,不过还是要贴。 delphi/help/Examples/jpeg 有个例子,你看看吧。
C chiu Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #5 image1.Picture.Bitmap.Assign(pic) 这一句出错
Z zlj555 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #6 不用那么麻烦; 首先在USE中加入:jpeg 然后 Image1.loadfromFile('c:/JPEG文件');
J justcool Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #9 呵呵,我原来的程序是从SQL SERVER取数据的,所以就把它精简了一点贴上来了
D delnus Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #10 uses Jpeg; 你看看帮助文件中,索引值TJPEGIMage,介绍的比较详细。 Image1.Picture.LoadFromFile('yourjpg')
H huazai Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-29 #11 bitmap:=Tbitmap.create; bitmap.assign(pic); image1.Picture.Bitmap.Assign(bitmap); bitmap.free; pic.free;
bitmap:=Tbitmap.create; bitmap.assign(pic); image1.Picture.Bitmap.Assign(bitmap); bitmap.free; pic.free;