procedure TForm1.Button1Click(Sender: TObject);
function BmpToIco(bmpfile, icofile: string): Boolean;
var
bmpF: TBitmap;
icoF: TIcon;
begin
try
bmpF := TBitmap.Create;
bmpF.LoadFromFile(bmpfile);
icoF := TIcon.Create;
icoF.Assign(bmpF);
icoF.SaveToFile(icofile);
finally
bmpF.Free;
icoF.Free;
end;
Result := True;
end; function IcoToBmp(icofile, bmpfile: string): Boolean;
var
icoF: TIcon;
bmpF: TBitmap;
begin
try
icoF := TIcon.Create;
icoF.LoadFromFile(icofile);
bmpF := TBitmap.Create;
bmpF.Assign(icoF);
bmpF.SaveToFile(bmpfile);
finally
icoF.Free;
bmpF.Free;
end;
Result := True;
end;begin
BmpToIco('tmp.bmp','tmp.ico');
IcoToBmp('tmp.ico','tmpico.ico');
end;
function BmpToIco(bmpfile, icofile: string): Boolean;
var
bmpF: TBitmap;
icoF: TIcon;
begin
try
bmpF := TBitmap.Create;
bmpF.LoadFromFile(bmpfile);
icoF := TIcon.Create;
icoF.Assign(bmpF);
icoF.SaveToFile(icofile);
finally
bmpF.Free;
icoF.Free;
end;
Result := True;
end; function IcoToBmp(icofile, bmpfile: string): Boolean;
var
icoF: TIcon;
bmpF: TBitmap;
begin
try
icoF := TIcon.Create;
icoF.LoadFromFile(icofile);
bmpF := TBitmap.Create;
bmpF.Assign(icoF);
bmpF.SaveToFile(bmpfile);
finally
icoF.Free;
bmpF.Free;
end;
Result := True;
end;begin
BmpToIco('tmp.bmp','tmp.ico');
IcoToBmp('tmp.ico','tmpico.ico');
end;
IcoToBmp也用ChangeFileExt(bmpfile,'.bmp')
北京非碘流行,于是有人跑到哈尔滨避难。哈尔滨“打非”指挥部紧急部署,从北京来人一律自费隔离12天。
于是部分北京人为了躲避隔离,从公路进入哈尔滨,自称不是来自北京。
4个北京人依次走进哈尔滨公路检查站,准备蒙混过关。
第一位,是个中年妇女。
检察人员问:“哪里人啊” 女:“哈尔滨的” 检察人员:“哦,那北京的非典多吧” “多,了不得了,我前几天到医院门口一瞧哇,乌央乌央的” 于是第一位被隔离了。
第二位,是一个老太太
检察人员:“北京的非碘多吧” 老太太见第一个没过去,心想,我可不能说露馅了:“电视里都看见了,挺多的” 检察人员:“大娘,要注意身体,平时都到哪里锻炼啊” 老太太:“我也就到天安门广场溜溜弯” 于是第二位也被隔离了。
第三位,是一个小伙
检察人员:“平时都到哪里去啊” 小伙子多了个心眼,“我也就逛逛中央大街,上上龙塔” 检察人员:“对了,你看中国甲A最NB的是哪个队阿” 小伙子:“那还用说么,咱国安啊,国安永远争第一啊” 于是,第三位被隔离了。
第四位,是一个干部模样的同志
检察人员:“你看中国甲A最NB的是哪个队阿” 还是干部见多识广,“甲A我不怎么看,我就看咱哈尔滨兰格” 检察人员,问了几句话都没有破绽,于是让他试体温。 体温试完,检察人员要收5毛钱。 干部:“老子在京城,去协和医院检查身体都不要钱,到你这穷乡僻壤的,试个破体温就收5毛!”