Power Builder - no puedo grabar ala unidad C: una imagen jpge de una camara web

 
Vista:
sin imagen de perfil

no puedo grabar ala unidad C: una imagen jpge de una camara web

Publicado por JOHN (1 intervención) el 29/04/2014 17:19:29
Buenas con todos los desarrolladores en power builder 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------------------------


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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()--------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 ------------------------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 PUEDEN AYUDAR
TAMBIEN ME PUEDEN 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 GRACIASSSSSSS ATODOS POR LA AYUDA
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder