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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Enforce Width and Height on ImageIOAcquireBitmap

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Josir Posted - Nov 18 2015 : 15:34:22
Hi folks,

I have an application that uses several scanner devices. On some of them, the Width and Height is not set properly.

How can I enforce the Width/Height bitmap size before or after acquire the image ?

procedure TfrmMain.ImageIOAcquireBitmap(Sender: TObject;
  ABitmap: TIEBitmap; var Handled: Boolean);
var NomeArquivo:String;
begin
  NomeArquivo := EditDest.Text + Filename + '_' + StrZero(Counter,4)+'.tif';
  ImageIO.AttachedIEBitmap := ABitmap;
  ImageIO.AttachedIEBitmap.PixelFormat := ie1g;
  if Debug then
    with ImageIO.AttachedIEBitmap do
    begin
      Height := 3507;
      Width := 2496;
      ShowMensagem('Attached Height:'+IntToStr(Height));
      ShowMensagem('Attached Width:'+IntToStr(Width));
    end;

6   L A T E S T    R E P L I E S    (Newest First)
Josir Posted - Nov 27 2015 : 10:32:22
Hi Bill. It works perfectly!

I have just to add unit hyieutils on Uses clause.

Thanks a lot!
w2m Posted - Nov 23 2015 : 11:01:52
Try using TImageEnProc to resample:
procedure TfrmMain.ImageIOAcquireBitmap(Sender: TObject;
  ABitmap: TIEBitmap; var Handled: Boolean);
var
NomeArquivo:String;
iImageEnProc: TImageEnProc;
begin
  NomeArquivo := EditDest.Text + Filename + '_' + StrZero(Counter,4)+'.tif';
  try
  iImageEnProc := TImageEnProc.Create(nil);
  iImageEnProc.AttachedIEBitmap := ABitmap;
  iImageEnProc.Resample(3507, 2496, rfFastLinear, True);
  if Debug then
    with iImageEnProc.AttachedBitmap do
    begin
      ShowMensagem('Attached Height:'+IntToStr(Height));
      ShowMensagem('Attached Width:'+IntToStr(Width));
    end;
  finally
    iImageEnProc.Free;
   end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Josir Posted - Nov 23 2015 : 10:50:13
Hi Nigel,

I think the version I use do not have yet the Resample method :(

I´m still using 4.0 version (I bought it in 2011).

Is there any workaround ?

Thanks in advance,
Josir.


xequte Posted - Nov 19 2015 : 17:05:55
Hi

Sorry, I've got you now. The scanner does give you some contol over acquisition size, but it sounds like you'd be better to resize it after acquisition:

aIEBitmap.Resample( 3507, 2496, rfFastLinear, True );

More Info:

http://www.imageen.com/help/TIEBitmap.Resample.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Josir Posted - Nov 19 2015 : 04:03:35
Hi Nigel,

the image acquired has a size different from my need. I have to generate an image with 3507 x 2496 size.

I tried to force the height and width but this is not working.

Is there a way to ask a TWAIN scanner to generate an image of specific size ?

Or: Is there way to change the image size after acquire ?

Thanks for the support!
xequte Posted - Nov 18 2015 : 16:17:02
Hi

Sorry I don't see what you are trying to do here. Are you saying the ABitmap returned in ImageIOAcquireBitmap() has a height and width of zero?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com