Method of converting BMP by Super Star format

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.