Problemas al almacenar una foto tomada con una camara web desde power builder

BuenOS dias EXPERTO tengo un problema no me sale o no puedo almacenar una imagen o foto jpge en la unidad c:\fotos
tengo mi ventana llamada wn_camara con los sgts controles
1. Control picture
2, caja de texto
3.boton GRABAR_FOTO
4. 3 OPTIONS BUTTON (FOTO DE FRENTE , FOTO PERFIL IZQUIERDO , FOTO PERFIL DERECHO )
OBJETO APLICACION (GLOBAL EXTERNAL FUNCTIONS)------------------------------
function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long li_x ,long li_y ,long nWidth ,long nHeight ,ulong ParentWin ,long nId ) LIBRARY 'AVICAP32.DLL'
FUNCTION ulong SendMessage() LIBRARY "User32.dll"
WN_CAMARA_WEB VARIABLES DE INSTANCE------------------------
Integer Msg,HWnd
Uint lhand
Constant long GET_FRAME = 1084
Constant long COPY = 1054
Constant long WM_USER = 1024
Constant long WM_CAP_START = WM_USER
Constant long WM_CAP_STOP = WM_CAP_START + 68
Constant long WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Constant long WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11
Constant long WM_CAP_SAVEDIB = WM_CAP_START + 25
Constant long WM_CAP_GRAB_FRAME = WM_CAP_START + 60
Constant long WM_CAP_SEQUENCE = WM_CAP_START + 62
Constant long WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20
/////Constant long WM_CAP_EDIT_COPY = WM_CAP_START + 20 //////
Constant long WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+ 63
Constant long WM_CAP_SET_OVERLAY =WM_CAP_START+ 51
Constant long WM_CAP_SET_PREVIEW =WM_CAP_START+ 50
Constant long WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6
Constant long WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2
Constant long WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3
Constant long WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5
Constant long WM_CAP_SET_SCALE=WM_CAP_START+ 53
Constant long WM_CAP_SET_PREVIEWRATE=WM_CAP_START+ 52
Constant long PREVIEWRATE = 30 //////////////////////////////////////////////
Long wm_cap_savedatdib = 1049
Long wm_cap_dlg_videoformat = 1065
Long wm_cap_dlg_videosource = 1066
Long wm_cap_dlg_videodisplay = 1067
Long wm_cap_get_videoformat = 1068
Long wm_cap_set_videoformat = 1069
Long wm_cap_dlg_videocompression = 1070
Long cf_bitmap = 2
Long wm_close = 16
Ulong scrcopy = 32
string gs_pic_path
string gs_cd_path
string gs_path
string gs_ds_pic
string gs_ds_cd
string gs_cd_rq
long gl_pic_sj = 0
wn_camara OPEN()--------------------------
string lpszName
ulong l1
l1=handle(this)
lpszName='webcam.'
lhand=capCreateCaptureWindowA(lpszName,262144+12582912+1073741824 + 268435456 ,300,10,450,500,l1,0)
if lhand <> 0 then
send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0)
send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0, 0)
send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0, 0)
send(lhand, WM_CAP_DRIVER_CONNECT, 0, 0) ///////////////////////// hace que la imagen se vea o no
send(lhand, WM_CAP_SET_SCALE, 1, 0)
send(lhand,WM_CAP_GRAB_FRAME, 0, 0)
Send(lhand, WM_CAP_SAVEDIB, 0, 0)
send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0)
send(lhand, WM_CAP_SET_OVERLAY, 1, 0)
send(lhand, WM_CAP_SET_PREVIEW, 1, 0) //// captura la imagen
end if
boton GRABAR_FOTO ------------------------------------------
string ls_path, ls_file,ls_nombre
int li_rc
ls_nombre =sle_1.text ////NOMBRE Y APELLIDO DE LA PERSONA
ls_file="c:\fotoss"
if rb_1.checked= true then //// RB_1,TEXT ="FOTO DE FRENTE"
send(lhand, WM_CAP_SET_PREVIEW, 0, 0)
Send(lhand,WM_CAP_FILE_SET_CAPTURE_FILEA,0,0);
Send(lhand, WM_CAP_DRIVER_DISCONNECT, 0, 0)
ls_path = "imagen"+'_'+rb_1.text+'_'+ls_nombre
li_rc= GetFileSaveName ( "Select Archivo",ls_path,ls_file,"imagen","FORMATO JPG(*.jpg),*.JPG,Jpeg(*.jpeg),*.jpeg,Bitmap files(*.bmp),*.bmp","c:\fotoss",32770)
elseif rb_2.checked= true then //// RB_2,TEXT ="FOTO DE LADO DERECCHO"
elseif rb_3.checked= true then /// RB_3,TEXT ="FOTO DE LADO IZQUIERDO"
end if
nota _
no se guarda la foto en la unidad c:\foto por favor me puedes ayudar
tambien me puedes ayudar para que se guarde automaticamente en la ruta sin que tenga que ponerle un nombre ,porque son 3 fotos por persona seria mejor que sea automatico y mostarlo en un control picture
muchas graciassssss por la ayuda

Añade tu respuesta

Haz clic para o