Foro | | | | - Página 1 - |
|  Rolf Koch | Hallöchen heut frag Yo veces así en el Runde, como I, con Drucken nie soviel gemacht habe. Folgende Problemstellung: Wir haben en uns una Computer con Drucker en el Lager. Wenn una Kunde una Gerät gekauft ha y a el Kasse bezahlt ha, así kommt en uns una entsprechender Beleg de el Drucker, así wir el Waschmaschine, TV oder solch una Zeugs raussuchen puede. Jetzt sería Me gusta una nebenbeilaufendes Tool escribir, welches una Sound abspielt, si una solcher Beleg de el Drucker kommt. Meint Ihr, Yo podría dies irgendwie erreichen? |
| | | | |
| | | | - Página 11 - |
| |  Rolf Koch | Bekomme desafortunadamente una Warnung: Fehler en el Ensamblador Linker ??? |
| | | | |
| |  | Normal no,
liegts al Pfad? Pack veces después de c:\dev\test\test.xprf |
| | | | |
| |  Rolf Koch | Jo klappt - Kapiere lo que quiere decir. |
| | | | |
| |  | Wenn el Kameraeinstellungen algo como como "Automatische Belichtung/ Helligkeit" anbieten Yo esta Función hierzu deaktivieren. |
| | | | |
| |  Rolf Koch | | | | | |
| |  Rolf Koch | Yo komm así no está claro. Yo ahora testweise veces sin Scroller y intenta el Cambild abzufragen. Papercolor egal welche Farbe es siempre 255  |
| | | | |
| |  | Der erste Param de getPaperColor muss el DC ser en el el Pixel mentira - schau mal en welchem DC el Kamerabild gemalt se. ¿Puede Usted veces Su Kameracode puesto? Wichtig es esta dass el Bild en el "preview"-Modus gemalt se en lugar de por Overlay. Morgen podría Yo a una Webcam kommen y auch incluso testen. |
| | | | |
| |  Rolf Koch | Hier el Code (es Su IFanta) adaptado: KompilierenMarcaSeparación {$cleq}
{$res nomanifest,noversioninfo}
{$res icon if.ico}
const appTitle="iFantaCam"
const appVer=0.0
#include C:\\p00x\\thread.archive\\thread.archive\\lib\\thread.pcu = thread.
long paperColor,oldPaperColor,diff,h
declare _dulcoiF%
proc dulcoiF
case _dulcoiF% : return
_dulcoiF%:=1
settimer 1;waitinput;killtimer
_dulcoiF%:=0
endproc
Proc BILDSAVE
Parameters Filename$
Sendmessage(previewHandle,&WM_CAP_FILE_SAVEDIB,0,ADDR(Filename$))
EndProc
long mouse.x,mouse.y
mem mouse.mem=point
mouse.doLeftKlick {
mouse_event(2, 0,0 ,0,0)
mouse_event(4, 0,0 ,0,0)
dulcoiF
}
lm_{return if(getasynckeystate(1)==0,false,true)}
rm_{return if(getasynckeystate(2)==0,false,true)}
whilem_{
while (lm_() | rm_()){
sleep 10
}
}
getmousepos{
GetCursorPos(mouse.mem)
mouse.x=mouse.mem::x&
mouse.y=mouse.mem::y&
}
setmousepos(long x,y){;setcursorpos(x,y);}
clipmouse(long x,y,xx,yy){
mem mem=rect
mem::left&=x
mem::top&=y
mem::right&=xx
mem::bottom&=yy
clipcursor(mem)
dispose mem
}
mouse.close{
dispose mouse.mem
}
Def &WM_CAP_FILE_SAVEAS 1047
Def &WM_CAP_FILE_SAVEDIB 1049
const wm_cap_start = $400
const wm_cap_edit_copy = (wm_cap_start + 30)
const wm_cap_driver_connect = (wm_cap_start + 10)
const wm_cap_set_previewrate = (wm_cap_start + 52)
const wm_cap_set_overlay = (wm_cap_start + 51)
const wm_cap_set_preview = (wm_cap_start + 50)
const wm_cap_set_scale = (wm_cap_start + 53)
const wm_cap_driver_disconnect = (wm_cap_start + 11)
const wm_cap_dlg_videocompression = (wm_cap_start + 46)
const wm_cap_dlg_videodisplay = (wm_cap_start + 43)
const wm_cap_dlg_videosource = (wm_cap_start + 42)
const wm_cap_dlg_videoformat = (wm_cap_start + 41)
long dll=usedll("avicap32.dll")
windowtitle appTitle
windowstyle 80 | 1024
window 0,0 - 0,0
windowstyle 1 | 2 | 4 | 8 | 16 | 512
long dhWnd=createwindow(0,apptitle,100,100,350,300)
setStyle dhwnd,349118464
long nCameraID
long previewHandle = external("avicap32.dll","capCreateCaptureWindowA","Video", WS_CHILD + WS_VISIBLE, 0, 0, width(dhwnd), height(dhwnd), dhwnd, 1)
SendMessage(previewHandle, WM_CAP_DRIVER_CONNECT, nCameraID, 0)
SendMessage(previewHandle, WM_CAP_SET_PREVIEWRATE, 200, 0)
SendMessage(previewHandle, WM_CAP_SET_SCALE, true, 0)
SendMessage(previewHandle, WM_CAP_SET_OVERLAY, true, 0)
SendMessage(previewHandle, WM_CAP_SET_PREVIEW, true, 0)
usermessages wm_close,wm_size,wm_contextmenu
long hWndXX=width(dhwnd),hWndYY=height(dhwnd)
do {
thread.start 1,8
waitinput
thread.stop 1
select %umessage
caseof wm_close : break
caseof wm_contextmenu
select dhWnd.contextMenu()
caseof wm_close : break
endselect
endselect
}
SendMessage(previewHandle, WM_CAP_DRIVER_DISCONNECT, nCameraID, 0)
destroywindow(previewHandle)
freedll dll
end
nProc getPaperColor(long dc,x,y){
long r,g,b,col,q,w
whileloop 0,2 {
q=loop
whileloop 0,2 {
w=loop
col=getPixel(dhwnd,x+q,y+w)
add r,getRValue(col)
add g,getGValue(col)
add b,getBValue(col)
}
}
div r,9
div g,9
div b,9
add r,g
add r,b
div r,3
return r
}
dhWnd.contextMenu{
createmenu
if getstyle(dhwnd)==349118464 {
appendmenu 2000,"Shot"
} else {
appendmenu 2000,"Shot"
}
separator
appendmenu 1000,"Videosource"
appendmenu 1010,"Videoformat"
appendmenu 1020,"Videodisplay"
appendmenu 1030,"Videokompression"
separator
appendmenu 3000,"Beenden"
getmousepos()
trackmenu mouse.x,mouse.y
select %menuitem
caseof 1000 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOSOURCE,0,0)
caseof 1010 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOFORMAT,0,0)
caseof 1020 : sendmessage(previewHandle,WM_CAP_DLG_VIDEODISPLAY,0,0)
caseof 1030 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOCOMPRESSION,0,0)
caseof 2000 : BILDSAVE "C:\\TEMP\\TEST.BMP"
caseof 3000 : return wm_close
endselect
setmenuitem 0
return false
}
thread.do{
BILDSAVE "C:\\TEMP\\TEST.BMP"
oldPaperColor=paperColor
paperColor=getPaperColor(hDC,100,100)
diff=paperColor-oldPaperColor
if diff>64 {
SetText dhwnd,"BOING, Blatt wurde gedruckt! "+Str$(diff)
} elseif diff<-64 {
SetText dhwnd,"BOING, Blatt wurde aus dem drucker genommen!"
}
long xx=width(dhwnd),yy=height(dhwnd)
if xx-hwndXX+yy-hwndyy {
setwindowpos previewHandle=0,0 - width(dhwnd),height(dhwnd);0
hWndXX=xx
hWndYY=yy
}
return null
}
/*
clearclip
put tri(getwindowlong(hwnd,gwl_style))
349118464
256
-1810948096-1810948096
256
setstyle hwnd,-1810948096
*/
|
| | | | |
| |  | Höllencode,
debería primero todo thread.pcu expandido voluntad.
Setze veces SendMessage(previewHandle, WM_CAP_SET_OVERLAY, true, 0) en falso en lugar de true. |
| | | | |
| |  Rolf Koch | War me klar, war sí sólo n testcode y el ändern en falso ändert desafortunadamente auch nichts restos en 255. |
| | | | |
| |  | Löl, tener ne WebCam rausgekrümelt y lo fix umgefärcht: KompilierenMarcaSeparación {$cleq}
const appTitle="iFantaCam"
const appVer=0.0
long paperColor,oldPaperColor,diff,h
Proc BILDSAVE
Parameters Filename$
Sendmessage(previewHandle,&WM_CAP_FILE_SAVEDIB,0,ADDR(Filename$))
EndProc
long mouse.x,mouse.y
mem mouse.mem=point
mouse.doLeftKlick {
mouse_event(2, 0,0 ,0,0)
mouse_event(4, 0,0 ,0,0)
}
lm_{return if(getasynckeystate(1)==0,false,true)}
rm_{return if(getasynckeystate(2)==0,false,true)}
whilem_{
while (lm_() | rm_()){
sleep 10
}
}
getmousepos{
GetCursorPos(mouse.mem)
mouse.x=mouse.mem::x&
mouse.y=mouse.mem::y&
}
setmousepos(long x,y){;setcursorpos(x,y);}
clipmouse(long x,y,xx,yy){
mem mem=rect
mem::left&=x
mem::top&=y
mem::right&=xx
mem::bottom&=yy
clipcursor(mem)
dispose mem
}
mouse.close{
dispose mouse.mem
}
Def &WM_CAP_FILE_SAVEAS 1047
Def &WM_CAP_FILE_SAVEDIB 1049
const wm_cap_start = $400
const wm_cap_edit_copy = (wm_cap_start + 30)
const wm_cap_driver_connect = (wm_cap_start + 10)
const wm_cap_set_previewrate = (wm_cap_start + 52)
const wm_cap_set_overlay = (wm_cap_start + 51)
const wm_cap_set_preview = (wm_cap_start + 50)
const wm_cap_set_scale = (wm_cap_start + 53)
const wm_cap_driver_disconnect = (wm_cap_start + 11)
const wm_cap_dlg_videocompression = (wm_cap_start + 46)
const wm_cap_dlg_videodisplay = (wm_cap_start + 43)
const wm_cap_dlg_videosource = (wm_cap_start + 42)
const wm_cap_dlg_videoformat = (wm_cap_start + 41)
long dll=usedll("avicap32.dll")
windowtitle appTitle
windowstyle 80 | 1024
window 0,0 - 0,0
windowstyle 1 | 2 | 4 | 8 | 16 | 512
long dhWnd=createwindow(0,apptitle,100,100,350,300)
setStyle dhwnd,349118464
long nCameraID
long previewHandle = external("avicap32.dll","capCreateCaptureWindowA","Video", WS_CHILD + WS_VISIBLE, 0, 0, width(dhwnd), height(dhwnd), dhwnd, 1)
SendMessage(previewHandle, WM_CAP_DRIVER_CONNECT, nCameraID, 0)
SendMessage(previewHandle, WM_CAP_SET_PREVIEWRATE, 200, 0)
SendMessage(previewHandle, WM_CAP_SET_SCALE, true, 0)
SendMessage(previewHandle, WM_CAP_SET_OVERLAY, false, 0)
SendMessage(previewHandle, WM_CAP_SET_PREVIEW, true, 0)
usermessages wm_close,wm_size,wm_contextmenu
long hWndXX=width(dhwnd),hWndYY=height(dhwnd)
setWIndowPos previewHandle=0,0 - 320,200
//
long dc=getDC(previewHandle)
//
do {
waitinput 100
thread.do()
select %umessage
caseof wm_close : break
caseof wm_contextmenu
select dhWnd.contextMenu()
caseof wm_close : break
endselect
endselect
}
SendMessage(previewHandle, WM_CAP_DRIVER_DISCONNECT, nCameraID, 0)
destroywindow(previewHandle)
freedll dll
end
nProc getPaperColor(long dc,x,y){
long r,g,b,col,q,w
whileloop 0,2 {
q=loop
whileloop 0,2 {
w=loop
col=getPixel(dc,x+q,y+w)
add r,getRValue(col)
add g,getGValue(col)
add b,getBValue(col)
}
}
div r,9
div g,9
div b,9
add r,g
add r,b
div r,3
return r
}
dhWnd.contextMenu{
createmenu
if getstyle(dhwnd)==349118464 {
appendmenu 2000,"Shot"
} else {
appendmenu 2000,"Shot"
}
separator
appendmenu 1000,"Videosource"
appendmenu 1010,"Videoformat"
appendmenu 1020,"Videodisplay"
appendmenu 1030,"Videokompression"
separator
appendmenu 3000,"Beenden"
getmousepos()
trackmenu mouse.x,mouse.y
select %menuitem
caseof 1000 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOSOURCE,0,0)
caseof 1010 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOFORMAT,0,0)
caseof 1020 : sendmessage(previewHandle,WM_CAP_DLG_VIDEODISPLAY,0,0)
caseof 1030 : sendmessage(previewHandle,WM_CAP_DLG_VIDEOCOMPRESSION,0,0)
caseof 2000 : BILDSAVE "C:\\TEMP\\TEST.BMP"
caseof 3000 : return wm_close
endselect
setmenuitem 0
return false
}
thread.do{
//BILDSAVE "C:\\TEMP\\TEST.BMP"
oldPaperColor=paperColor
paperColor=getPaperColor(dc,160,120)
diff=paperColor-oldPaperColor
if diff>64 {
SetText dhwnd,"BOING, Blatt wurde gedruckt! "+Str$(diff)
} elseif diff<-64 {
SetText dhwnd,"BOING, Blatt wurde aus dem drucker genommen!"
}
return null
}
/*
clearclip
putclip stri(getwindowlo d,gwl_style))
349118464
256
-1810948096-1810948096
256
setstyle hwnd,-1810948096
*/
Como lustig es el porque... funktioniert!  |
| | | | |
| |  Rolf Koch | Bohaaaa como GEIIIILLL - DANKE IF - Jetzt tener Yo una Grundlage Si usted me nun verraten kannst, Yo lo umgehe, dass Yo no en C:\DEV\TEST speichern muss. Immer si yo woanders speichere, bekomme Yo Ensamblador Meldung |
| | | | |
|
RespuestaTema opciones | 117.752 Views |
ThemeninformationenDieses Thema ha 6 subscriber: |
|