Flywolf (mailto:flywolf@ynmail.com)
Recently, I stumbled upon a method of Super star-> bmp.
First, please download the latest "Super Star 3.4Beta 7", after installation, run DELPHI5, select Component->import ActiveX control, and then you will find that "Import ActiveX" has a choice of "Pdg2 Type Library (Version 1.0) "..., I don't have to say the rest."
My method:
procedure TMainForm.PdgToBmp(FPdgName, FBmpName: string);//FPdgname--超星格式文件名 FBmpName--要保存的BMP文件名。
var i:integer;
j:boolean;
begin
ClipBoard.Clear;
MyPdg.LoadPage(FPdgName,0,0,10);
Mypdg.Refresh;
MyPdg.CopyToClipBoard (0,0,MyPdg.PageWidth ,MyPdg.PageHeight); //这一操作需要一段时间
j:=false;
while j=false do
begin
MyPdg.CopyToClipBoard (0,0,MyPdg.PageWidth ,MyPdg.PageHeight);
for i:=0 to clipboard.FormatCount -1 do //检测ClipBoard中是否有位图,因为我在调试中发现有时执行MyPdg.CopyToClipBoard (0,0,MyPdg.PageWidth ,MyPdg.PageHeight);会出错,只有检测到有位图存在时,再进行复制.
if Clipboard.Formats[i]=2 then j:=true;
end;
Bmp.LoadFromClipBoardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);
bmp.PixelFormat:=pf1bit ;
bmp.SaveToFile(FBmpName);
end;
In addition, if you are converting the files in the entire directory continuously, insert them in the adjacent two conversion process
Sleep (1000); give the Super star a little time, or she will have a problem, do not work!!!
And mypdg.visible must set true;
I found that the conversion of BMP after the recognition of the effect of Tsinghua OCR is not good, if you have any ideas, take out the public share it!