Delphi-PRAXiS
Seite 4 von 4   « Erste     234   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi OCR für Arme, und ich bin noch ärmer (https://www.delphipraxis.net/133378-ocr-fuer-arme-und-ich-bin-noch-aermer.html)

ken_jones 21. Jul 2009 12:35

Re: OCR für Arme, und ich bin noch ärmer
 
Zitat:

Zitat von Laufi
Hallo!
Das freut mich dass es dir gefällt :o Dafür habe ich rasch was extra für dich geschrieben :-D

Cool Laufi,
hier noch 2 Zeilen damit es auch unter Vista mit Delphi 2009 läuft:

Delphi-Quellcode:
unit Main;
...
procedure TSimpleOCR.Init(Font: TFont);
var
  Alphabet: string;
  ch: Char;
begin
  for ch := #32 to #126 do // <-- Edit 1: statt #255
    Alphabet:= Alphabet + ch;
  Init(Alphabet, Font);
end;

...

function TSimpleOCR.BitmapFromText(const S: string): TBitmap;
begin
  Result:= TBitmap.Create;
  Result.PixelFormat := pf1bit; // <-- Edit 2: Zeile eingefügt -> Cleartype/Antialiasing aus
  Result.Canvas.Font:= FFont;
  with Result.Canvas.TextExtent(S) do
    Result.SetSize(cx, cy);
  Result.Canvas.TextOut(0, 0, S);
end;

...


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:04 Uhr.
Seite 4 von 4   « Erste     234   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz