请问此控件支持多少种图片类型,好像.jpg图片类型不支持,真是奇怪???
解决方案 »
- 给TabSheet在Tab标签处加个关闭按钮
- 各位父老乡亲,wudi_1982今天25岁生日,已经长大成人了,等年底再取个媳妇。特散出200分款待大家。
- 新手问题----------ListBoxInt.ItemIndex
- 关于打印的问题
- 如何把一篇Word 文档保存到数据库里?
- 简单的VC转DELPHI问题,立马结帐
- 请问那里有图片下载
- delphi7好像多了很多东西,也少了不少东西
- 高手指正,这句语言错在哪里?
- Midas的demo程序为什么不能在两台机子上运行
- 当ToolButton的style的设置为tbsDropDown的时候,如何处理点击小箭头的响应事件?
- 兄弟们辛苦了,谁能进来帮我一下!!!
var
Str : String;
Jpeg : TJPEGIMAGE;
begin
Formmain.opd_Photo.Filter := 'BMP files (*.bmp)|*.BMP|JPG files (*.jpg)|*.JPG';
if Formmain.opd_Photo.Execute then
begin
if not FileExists(Formmain.opd_Photo.filename) then
begin
Application.MessageBox('您选择的文件不存在!','提示信息',$00001040);
Exit;
end;
Str := ExtractFileExt(Formmain.opd_Photo.filename);
Str := Copy(Str,2,3);
if Str='bmp' then
img_photo.Picture.Bitmap.LoadFromFile(Formmain.opd_Photo.FileName)
else if (Str='jpg') or (Str='jpeg') then
begin
Jpeg := TJPEGIMAGE.Create;
Jpeg.LoadFromFile(Formmain.opd_Photo.FileName);
img_photo.Picture.Bitmap.Assign(Jpeg);
end;
end;
end;