VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234567[8]910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 18:11:32 05/10/01 Thu
Author: Tim Carter
Subject: Re: Frame support in TScanner
In reply to: Michel 's message, "Re: Frame support in TScanner" on 07:51:10 03/19/01 Mon

Sorry for the delay getting back... the code worked great.

Thanks,

Tim.


>Hi Tim,
>
>I have not done more work on this, but a user of
>Envision has successfully got it to work. Here
>
>is the email he sent me. Let me know if this works on
>your scanner.
>
>Best regards,
>
>Michel
>
><<
>Subject: Re: Envision library
>Date: Thu, 9 Nov 2000 07:55:48 +0100
>From: "Tomaz Koritnik" <tomaz.koritnik@kiss.uni-lj.si>
>To: "Michel Brazeau" <michel@intervalsoftware.com>
>
>Hi
>
> Here you have both functions for getting snd
>settng layout. They work
>with my scanner, but try them on your's as well.
>
>TSingleRect = record Left, Top, Right, Bottom: Single;
>end;
>
>function TScanner.GetImageLayout( var Rect:
>TSingleRect ): Boolean;
>var
> twRC: TW_UINT16;
> twImageLayout: TW_IMAGELAYOUT;
>begin
> if not FTwainLoaded then LoadTwain;
> if not FSourceloaded then SelectScanner;
> FillChar(twImageLayout, SizeOf(twImageLayout), 0);
> twRc := FTwainData.DsmEntry( @FTwainData.AppId,
>@FTwainData.SourceId,
>DG_IMAGE, DAT_IMAGELAYOUT, MSG_GET, @twImageLayout );
> case twRC of
> TWRC_SUCCESS :
> begin
> Rect.Left := FIX32ToSingle(
>twImageLayout.Frame.Left );
> Rect.Top := FIX32ToSingle(
>twImageLayout.Frame.Top );
> Rect.Right := FIX32ToSingle(
>twImageLayout.Frame.Right );
> Rect.Bottom := FIX32ToSingle(
>twImageLayout.Frame.Bottom );
> Result := true;
> end else
> begin
> Rect.Left := -1;
> Rect.Top := -1;
> Rect.Right := -1;
> Rect.Bottom := -1;
> Result := false;
> end;
> end;
>end;
>
>function TScanner.SetImageLayout( Rect: TSingleRect ):
>Boolean;
>var
> twRC: TW_UINT16;
> twImageLayout: TW_IMAGELAYOUT;
>begin
> if not FTwainLoaded then LoadTwain;
> if not FSourceloaded then SelectScanner;
> FillChar(twImageLayout, SizeOf(twImageLayout), 0);
> FTwainData.DsmEntry( @FTwainData.AppId,
>@FTwainData.SourceId, DG_IMAGE,
>DAT_IMAGELAYOUT, MSG_GET, @twImageLayout );
> twImageLayout.Frame.Left := SingleToFix32(
>Rect.Left );
> twImageLayout.Frame.Top := SingleToFix32( Rect.Top
>);
> twImageLayout.Frame.Right := SingleToFix32(
>Rect.Right );
> twImageLayout.Frame.Bottom := SingleToFix32(
>Rect.Bottom );
> twRc := FTwainData.DsmEntry( @FTwainData.AppId,
>@FTwainData.SourceId,
>DG_IMAGE, DAT_IMAGELAYOUT, MSG_SET, @twImageLayout );
> case twRC of
> TWRC_SUCCESS : Result := true;
> else
> Result := false;
> end;
>end;
>>>
>
>
>>I'm trying to add frame support to TScanner. I've
>>copied some test code that I found in enscan.pas but
>>the image frame doesn't change. I always get the
>>default height as set by the twain interface.
>>
>>twImageLayout.Frame.Left := SingleToFix32(0);
>>twImageLayout.Frame.Top := SingleToFix32(0);
>>twImageLayout.Frame.Right := SingleToFix32(8.5);
>>twImageLayout.Frame.Bottom :=
>>SingleToFix32fPageHeight);
>>twImageLayout.DocumentNumber := 1;
>>twImageLayout.PageNumber := 1;
>>twImageLayout.FrameNumber := 1;
>>
>>CallTriplet( @FTwainData.AppId,
>> @FTwainData.SourceId,
>> DG_IMAGE,
>> DAT_IMAGELAYOUT,
>> MSG_SET,
>> TW_MEMREF(@twImageLayout),
>> @twRC, FTwainData.DsmEntry
>> );
>>
>>Was there any more work done on the SetLayout
>>procedure?
>>
>>The units are set to inches. The scanner is a Fujitsu
>>309dc with auto doc feeder.
>>
>>btw, I'm using Envision for an internal imaging
>>project and it has been working for us beautifully.
>>Thanks.

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.