Hi Roger/All
I want to acquire image from a webcam using EZTwain Pro dll.
Local oT := EZ_Twain(), hDIB, nFileSize := 0, cFile := "C:\10Tec\ppsphoto.jpg", nImageHandle, nReply
IF TWAIN_OpenSource( "InPhoto ID WebCam" ) == 1
nImageHandle := TWAIN_AcquireNative(0,0)
nReply := TWAIN_WriteNativeToFilename(nImageHandle,cFile)
oBitMap:LoadFile(cFile)
TWAIN_FreeNative(nImageHandle)
IF nReply == 0
DC_Winalert("image successfully written to file")
ELSE
DC_Winalert("something went wrong")
ENDIF
EndIf
***
The nImageHandle := TWAIN_AcquireNative(0,0) return the image handle - DIB
How can I save the acquired image to a BLOB field without first saving it to a graphic file ?
Joe
Aquiring Image from Twain Device
Re: Aquiring Image from Twain Device
Try using TWAIN_AcquireToClipboard().
Code: Select all
DLLFUNCTION TWAIN_AcquireToClipboard(hWnd,nPixTypes) USING STDCALL FROM eztw32.dll
The eXpress train is coming - and it has more cars.
Re: Aquiring Image from Twain Device
TWAIN_AcquireToClipboard()
Does not exist.
Thanks
Does not exist.
Thanks
Re: Aquiring Image from Twain Device
from _dcfunct.prgunixkd wrote:TWAIN_AcquireToClipboard()
Does not exist.
Thanks
DLLFUNCTION TWAIN_AcquireToClipboard(hWnd,nPixTypes) USING STDCALL FROM eztw32.dll
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Aquiring Image from Twain Device
In _dcfunct.prg a lot of similar functions (DLLFUNCTION).
I'd like to know what they are doing!
In my opinion there still hides many treasures!
I'd like to know what they are doing!
In my opinion there still hides many treasures!
Re: Aquiring Image from Twain Device
Thanks. Work Fine.
How can i get the size of the image contained in a bitmap object without saving it to a filename ?
Something like GetBitmapSize(oBtimap) ---> nBytes
Thanks
Joe
How can i get the size of the image contained in a bitmap object without saving it to a filename ?
Something like GetBitmapSize(oBtimap) ---> nBytes
Thanks
Joe
Re: Aquiring Image from Twain Device
Why not use this ?
Code: Select all
// ---------------------------------------------------------------------------------
// int EZTAPI DIB_Width(HANDLE hdib);
// Width of DIB, in pixels (columns)
// ---------------------------------------------------------------------------------
function eztw32_DIB_Width(hDib)
local nNop := DllCall(nEztwDll,DLL_STDCALL,"DIB_Width", hDib)
#ifdef TESTMODE
msgbox("Width of DIB in pixels (columns): "+str(nNop),"DIB_Width")
#endif
return nNop
// ---------------------------------------------------------------------------------
// int EZTAPI DIB_Height(HANDLE hdib);
// Height of DIB, in lines (rows)
// ---------------------------------------------------------------------------------
function eztw32_DIB_Height(hDib)
local nNol := DllCall(nEztwDll,DLL_STDCALL,"DIB_Height", hDib)
#ifdef TESTMODE
msgbox("Height of DIB in lines (rows): "+str(nNoL),"DIB_Height")
#endif
return nNol
Klaus
Re: Aquiring Image from Twain Device
Another way to get the size is to save the clipboard to an XbpBitMap() object using :setBuffer().
The size will be in oBitmap:xSize and oBitmap:ySize.
The size will be in oBitmap:xSize and oBitmap:ySize.
The eXpress train is coming - and it has more cars.