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:54:44 03/12/01 Mon
Author: Michel
Subject: Re: Calling TWAIN driver in C++Builder
In reply to: Mike 's message, "Re: Calling TWAIN driver in C++Builder" on 02:56:17 03/07/01 Wed


Hi Mike,

The simplest way is to first load the DibHandle into a TDibGraphic, then copy it to a TBitmap:


Graphic = new TDibGraphic();

Graphic->AssignFromDIBHandle(DibHandle);
Graphic->XDotsPerInch = XDpi;
Graphic->DotsPerInch = YDpi;

Bitmap->Assign(Graphic);

delete Graphic;

Best regards,

Michel

>I do not understand as I am not accustomed to have to
>work with these DIB things. Could you please tell me
>how to convert the DibHandle your Acquire event
>returns to a TBitmap (or copy its contents to a
>TBitmap)?
>
>Also, how can I test if a TWAIN device is present?
>IsConfigured does not return false if no TWAIN device
>is present.
>
>Thanks,
>
>Mike
>
>>
>>Hi Mike,
>>
>>Try Bitmap->Assign(Graphic), where Graphic is any
>class
>>derived from TDibGraphic.
>>
>>Best regards,
>>
>>Michel
>>
>>>Thanks Michel,
>>>
>>>It compiles without errors now. How do I get the
>image
>>>returned by Acquire in a TBitmap (it does not have a
>>>Graphic property)?
>>>
>>>Mike
>>>
>>>>Hi Mike,
>>>>
>>>>You'll find a native CBuilder scan example at:
>>>>
>>>>www.intervalsoftware.com/files/scandemoCB5.zip
>>>>
>>>>Best regards,
>>>>
>>>>Michel
>>>>
>>>>>Hi Michel,
>>>>>Can you give me an example how to call the TWAIN
>>>>>driver in C++Builder? I have been trying to
>>translate
>>>>>your example in the help file to CB but I am doing
>>>>>something wrong with the definition of the event
>>>>>handler.
>>>>>My goal is to get the image scanned in a TBitmap.
>>>>>Thanks,
>>>>>Mike

[ 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.