ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Twain Duplex Scan
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zrygo

Armenia
16 Posts

Posted - Aug 06 2012 :  01:45:15  Show Profile  Reply
Using the demo "multi\multiview", TWAIN drivers,
I scan a paper to 4 pieces of TIFF files:
(
Front RGB
Rear RGB
Front Black/White
Rear Black/White
)

My question is how can I get the imformations of the TIFF files, For example: RGB or Black/White , Front or Rear, Hight , Width...?






42.88 KB

fab

1310 Posts

Posted - Aug 06 2012 :  05:03:18  Show Profile  Reply
The property TImageEnMView.ImageBitCount[] contains "1" for Black/White images, and "24" for RGB images. ImageWidth[] and ImageHeight[] of course contain width and height.
About front or rear there isn't a property because this is under the application control (maybe 0, 2, 4, ... is front, while 1, 3, 5... is rear).
Go to Top of Page

zrygo

Armenia
16 Posts

Posted - Aug 07 2012 :  05:01:33  Show Profile  Reply
thanks,

But now I have another question: the black/white picture has a little sloped, while the RGB one is normal! What's going on?
my codes:

procedure TForm1.ImageEnMIO1AcquireBitmap(Sender: TObject;
  ABitmap: TIEBitmap; var Handled: Boolean);
var
  idx:integer;
  filename:string;
  io:TImageEnIO;
begin
  io:=TImageEnIO.CreateFromBitmap(ABitmap);
  idx := ImageEnMView1.AppendImage();
  filename := 'c:\twain\page_'+format('%.8d',[idx+1])+'.tif';
  try
    if  ABitmap.BitCount=1 then
    begin
      io.Params.BitsPerSample:=1;
      io.Params.SamplesPerPixel:=1;
      io.Params.TIFF_Compression:=ioTIFF_CCITT1D;
    end
    else
      io.Params.TIFF_Compression:=ioTIFF_JPEG;

    io.SaveToFileTIFF(filename);
    ImageEnMView1.ImageFileName[idx] := filename;
    Handled := true;
  finally
    io.Free;
  end;


the red ellipse is the sloped part of the black/white picture:


19.75 KB



33.01 KB
Go to Top of Page

fab

1310 Posts

Posted - Aug 07 2012 :  13:08:33  Show Profile  Reply
It is normal for black/white (1 bit depth) images. To remove it you should at least acquire in gray scale (8 bits depth). Of course it is not possible to save gray scale with ioTIFF_CCITT1D.
Go to Top of Page

zrygo

Armenia
16 Posts

Posted - Aug 07 2012 :  17:43:56  Show Profile  Reply
You mean I have to acquire gray scale from the scanner?
Go to Top of Page

fab

1310 Posts

Posted - Aug 08 2012 :  00:39:22  Show Profile  Reply
Yes, if you want to reduce the "aliasing".
Go to Top of Page

zrygo

Armenia
16 Posts

Posted - Aug 08 2012 :  02:56:10  Show Profile  Reply
I acquire Black/White scale from the Kodak Capture Software, it won't occur the "aliasing", so it's the ImageEn's problem?
Go to Top of Page

fab

1310 Posts

Posted - Aug 16 2012 :  23:29:09  Show Profile  Reply
Aliasing is a "black/white" problem, not an ImageEn problem (unless I didn't understood the problem, of course). Please show me the image capture by Kodak Capture Software.
Go to Top of Page

zrygo

Armenia
16 Posts

Posted - Aug 17 2012 :  09:31:42  Show Profile  Reply
It's marvelous that the aliasing problem do not happen in the tests of ImageEn during these days...when it happen again, I will show you the image.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: