Webcam Capture Picture Tool

I want to write a program in VB 2010 that can capture photo using a webcam, and directly saves it to the database. Someone please help me. Thanks! 

Hi,
 Here is a small code a made a while back that uses the capCreateCaptureWindowA API to capture a webcam and save pictures when the Save Picture button is clicked. You can test it out by creating a new form project and adding 2 buttons and 1 picturebox.
Name one of the buttons (Button_SavePicture) and the other (Button_SetSizeColor). The picturebox i left as the default name (PictureBox1). In the Button_SavePicture click event you will want to change the path to where the images are saved or you will get
an error there. As far as saving it to a database i will have to leave that up to someone that knows about using them. There is also this LINK
where there is a few links to other ways using DirectShow and maybe more.
Imports System.Runtime.InteropServices
Public Class Form1
Dim cWnd As IntPtr = IntPtr.Zero
Dim devId As Integer = 0 '0 will be the first capture device found
Dim picnumber As Integer = 0
Dim tmppic As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Temp.dib")
Private Const WS_CHILD As Integer = &H40000000
Private Const WS_VISIBLE As Integer = &H10000000
Private Const WM_USER As Integer = &H400
Private Const WM_CAP_DRIVER_CONNECT As Integer = WM_USER + 10
Private Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_USER + 11
Private Const WM_CAP_SET_PREVIEW As Integer = WM_USER + 50
Private Const WM_CAP_SET_PREVIEWRATE As Integer = WM_USER + 52
Private Const WM_CAP_SET_SCALE As Integer = WM_USER + 53
Private Const WM_CAP_SAVEDIB As Integer = WM_USER + 25
Private Const WM_CAP_DLG_VIDEOFORMAT As Integer = WM_USER + 41
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Ansi)> Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As IntPtr
End Function
<DllImport("avicap32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> Private Shared Function capCreateCaptureWindowA(ByVal lpszWindowName As String, ByVal dwStyle As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hWndParent As IntPtr, ByVal nID As Integer) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> Private Shared Function DestroyWindow(ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If Not cWnd.Equals(IntPtr.Zero) Then
SendMessage(cWnd, WM_CAP_DRIVER_DISCONNECT, devId, Nothing)
DestroyWindow(cWnd)
End If
If System.IO.File.Exists(tmppic) Then System.IO.File.Delete(tmppic)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cWnd = capCreateCaptureWindowA(devId.ToString, WS_VISIBLE Or WS_CHILD, 0, 0, PictureBox1.Width, PictureBox1.Height, PictureBox1.Handle, 0)
If Not SendMessage(cWnd, WM_CAP_DRIVER_CONNECT, devId, Nothing) = IntPtr.Zero Then
SendMessage(cWnd, WM_CAP_SET_SCALE, 1, Nothing)
SendMessage(cWnd, WM_CAP_SET_PREVIEWRATE, 66, Nothing)
SendMessage(cWnd, WM_CAP_SET_PREVIEW, 1, Nothing)
Else
MessageBox.Show("Error connecting to capture device. Make sure your WebCam is connected and try again.")
cWnd = IntPtr.Zero
Me.Close()
End If
End Sub
Private Sub Button_SavePicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_SavePicture.Click
SendMessage(cWnd, WM_CAP_SAVEDIB, 0, tmppic)
Dim bmp As New Bitmap(tmppic)
Dim saveas As String = "C:\TestFolder\MyPic_" & picnumber.ToString & ".jpg"
picnumber += 1
bmp.Save(saveas, Imaging.ImageFormat.Jpeg)
bmp.Dispose()
End Sub
Private Sub Button_SetSizeColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_SetSizeColor.Click
'Shows a dialog window to choose the size and color depth of the image that the webcam is capable of using.
SendMessage(cWnd, WM_CAP_DLG_VIDEOFORMAT, 0, Nothing)
End Sub
End Class

Similar Messages

  • Manipulating Webcam capture??????

    Hi
    I have successfully managed to capture, transmit, receive and display (using an applet) a webcam capture using jmf.
    However I want to let the user to put their mouse on the applet and be able to scroll around, zoom in and out etc..
    Any suggestions?

    dear Fergus
    My main objective is to capture / preview video using an applet and then capture a still image. save this still image to a file in users machine and then upload the file to the server at a specified folder.
    this applet is a part of Student Registration system and to generate ID cards for students.
    can you help me in this regards ? I have catagorized the requirements and other details. I am pasting the same here.
    Video Capture Module
    Objective: To capture a still image from a web page and Upload the image to specified folder on the server.
    Technologies to be used: JAVA Applets, HTML & Servelets.
    Synopsis: This application basically involves use of Java Media Framework. The primary objectives of this module are categorized according to the functionality.
    1)     Detect the video capture device on the users machine.
    2)     Preview the Live Video from the Detected Compatible Video Capture device.
    3)     Ask for user to click to take a snap and save the file in users machine at some temporary location with some unique file name.
    4)     Upload the file to the server at the specified path.
    There are a few constraints to this application. These are identified in following according to severity of the constraint
    1)     Minimal download time for the applet and supporting files.
    2)     Browser compatibility with Internet Explorer 4.0 upward as well as Netscape Navigator 4.0 upward.
    3)     User interface flexibility and easy to plug-in to the main module.
    4)     Reusability of this module for other purposes.
    There are few technological hurdles involved in doing this. These are stated below in order of severity.
    1)     Detecting the Capture Device on users machine.
    2)     User should not be asked to install Java Media Studio on his / her machine. Whatever the files are required should be loaded at the runtime.
    3)     Making the applet compatible with both the browser technologies.
    Following assumptions are being made
    1)     The browsers are capable to handle applets i.e. the JVM & Java Plug-in are already installed.
    2)     Video capture device Drivers are installed in the machine and the Camera is plugged in to the system.
    The assumptions are prerequisite and must be met.
    Details of the Sub Modules:
    SM-1: Detect Video capture Device in users machine.
    This involves following steps
    1)     Initialize the applet and get permissions to access the system resources such as capture devices and other input devices. Having the signed applet with the required premissions can do this.
    2)     Once we have the permission to access the devices we can scan various input devices and store the information in some temporary place such as cookie.
    3)     If Compatible Video Capture device is found then query the Video capture device.
    4)     If the Video capture device is not found then prompt user to install the Video capture device and revert back to starting the applet again.
    5)     Check for the Device Capabilities. Compare that with our requirements.
    6)     If things are ok then we can proceed to next step else go back to step 4.
    7)     Save the device info for the future use possibly in a cookie.
    SM-2: Preview the Live Video from the Detected Compatible Video Capture device.
    This involves following steps
    1)     Read the information from the cookie.
    2)     Initialize the viewer for the Live Video.
    3)     Present the live video.
    4)     As a tool tip, we should suggest the user to focus the camera and adjust the camera lens to get a sharp image.
    SM-3: Ask for user to click to take a snap and save the file in users machine at some temporary location with some unique file name.
    This involves following steps
    1)     Ask user to look in to camera straight. Not to blink eyes while picture is being taken.
    2)     User should then click the snap button. As a useful tip we may also provide a keyboard short cut to capture the still image.
    3)     Once the image is captured show the still image instead of the live video.
    4)     Give an option to user to recapture the still image.
    5)     If user feels his / her image has been satisfactorily captured.
    6)     Ask for confirmation to save and upload the image to server.
    SM-4: Upload the file to the server at the specified path.
    This involves following steps
    1)     Check for user authentication.
    2)     Check for file name.
    3)     Check for file size.
    4)     If all above is ok then upload the image to server at the specified path.
    regards
    Virendra

  • Problem with webcam capture

    Dear all,
    Using the Peter Parente's "webcam capture" library (Webcam Continuous Capture.vi), I faced some problems. In fact instead of showing for example one 320*240 picture it displayed some smaller pictures with some other parts of the picture indicator left blank(black).
    What's the problem. Any help would be appreciated.
    Regards

    Hello Smal,
    I did a search for this library and it looks like it was developed some time ago.  The FAQ on the download page seems to indicate that you need to make sure that your acquisition parameters in Windows and LabVIEW need to match in order for this to work properly.  There was also a data type change between Vision 6.1 and 7.0 so that could be related, but it sounds more likely it is something else.
    If your camera is DirectShow compatible and you have Vision, you can try IMAQ for USB.  This, like Peter Parente's Library, is not actively being developed or supported by National Instruments Applications Engineers, but you may have some more luck, assuming you are using more recent versions of LabVIEW and Vision.
    If there is a problem with a specific VI, please try to narrow down where the problem is occurring.  You may be able to post an image that might indicate how the library is failing.
    I hope this helps!  Good luck with your application.
    Regards,
    Angela
    Applications Engineer

  • N96 won't detect my captured pictures

    hi
    i have nokia n96 and 2-days ago i got corrupted (mass) memory error so i restarted the phone and it was ok.
    But now Photos application won't detect my Captured pictures. The directory tree of Images was intact after corruption (probably) so nothing changed there.
    I've got arout 500 pictures and they all show up in All pictures.
    Is there any way to make them back into Captured ? Any database file to delete and to refresh the image gallery ?
    Thanks,
    Kenan

    tried it.. lost ALL data - problem fixed -or is it... how can i know when i just lost all images
    *so this reminds me not to do ever (hard)  *#7370# reset
    close the thread please
    Message Edited by kenaneo on 09-Sep-2009 05:17 PM

  • I am planing to buy license of premier pro.I wan to capture picture from my camera .which card  i want to install ??

    i am planing to buy license of premier pro.I wan to capture picture from my camera .which card  i want to install ??

    If you're asking about Live Capture, where you record the camera feed direct to hard disk, then you need a Firewire interface or one of the (few) supported HDMI/SDI cards such as the AJA Kona, Matrox MX02 or BlackMagic Intensity Pro - however those have very specific motherboard requirements so you need to research them carefully before buying anything.
    For an intro to Live Capture I suggest you read the manual: Adobe Premiere Pro Help | Capturing and digitizing footage

  • Saving Captured picture from ADF Mobile Application into Remote Database

    Hi,
    I am developing adf mobile application by using Device Demo Application from ADF Mobile Samples.I had deployed this application into Android mobile and capturing picture.
    My Question is how can i save this captured pictured into Remote Database.
    Could any one help on this!!!
    Thanks in advance!!
    Regards
    Amar
    Edited by: 973755 on Nov 28, 2012 7:46 AM
    Edited by: 973755 on Nov 28, 2012 7:47 AM

    Hi Joe,
    Thanks for the reply!!
    As per your instructions i created two classes 1.GetConnection.java and 2.PictureBean.java
    in GetConnection.java i written following code
    package Picture;
    import java.sql.Connection;
    import java.sql.SQLException;
    import oracle.adfmf.framework.api.AdfmfJavaUtilities;
    public class GetConncetion {
    public GetConncetion() {
    super();
    protected static Connection conn = null;
    public static Connection getConnection() throws Exception {
    if (conn == null) {
    try {
    // create a database connection
    String Dir = AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory);
    String connStr = "jdbc:oracle:thin:@fusion.networks.com:1521:fusion"+Dir+"/DeviceDemo.db" ;
    conn = new SQLite.JDBCDataSource(connStr).getConnection();
    System.out.println("connection*******"+conn);
    } catch (SQLException e) {
    // if the error message is "out of memory",
    // it probably means no database file is found
    System.err.println(e.getMessage());
    return conn;
    and in PictureBean.java the following code i modified..
    package Picture;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import oracle.adf.model.datacontrols.device.DeviceManager;
    import oracle.jdbc.pool.OracleDataSource;
    public class PictureBean {
    public PictureBean() {
    super();
    String src;
    private int quality = 25;
    private int destination = DeviceManager.CAMERA_DESTINATIONTYPE_FILE_URI;
    private int source = DeviceManager.CAMERA_SOURCETYPE_PHOTOLIBRARY;
    private boolean allowEdit = false;
    private int encoding = DeviceManager.CAMERA_ENCODINGTYPE_JPEG;
    private int targetWidth = 0;
    private int targetHeight= 0;
    public void setQuality(int quality) {
    this.quality = quality;
    public int getQuality() {
    return quality;
    public void setDestination(int destination) {
    this.destination = destination;
    public int getDestination() {
    return destination;
    public void setSource(int source) {
    this.source = source;
    public int getSource() {
    return source;
    public void setAllowEdit(boolean allowEdit) {
    this.allowEdit = allowEdit;
    public boolean getAllowEdit() {
    return allowEdit;
    public boolean isAllowEdit() {
    return allowEdit;
    public void setEncoding(int encoding) {
    this.encoding = encoding;
    public int getEncoding() {
    return encoding;
    public void setTargetWidth(int targetWidth) {
    this.targetWidth = targetWidth;
    public int getTargetWidth() {
    return targetWidth;
    public void setTargetHeight(int targetHeight) {
    this.targetHeight = targetHeight;
    public int getTargetHeight() {
    return targetHeight;
    public String GetSource(String result) {
    String src = "";
    if( getDestination() == DeviceManager.CAMERA_DESTINATIONTYPE_DATA_URL ) {
    src = "data:image/gif;base64,";
    src = src + result;
    System.out.println("src value in GetSource is "+src);
    return src;
    public void setSource(String result) {
    PictureBean pb1=new PictureBean();
    String src = "data:image/gif;base64,";
    if( getDestination() == DeviceManager.CAMERA_DESTINATIONTYPE_DATA_URL ) {
    src = "data:image/gif;base64,";
    src = src + result;
    public String GetSource(){
    return src;
    public boolean savePicture() throws Exception {       
    boolean ret=false;
    PictureBean pb=new PictureBean();
    String pic= pb.GetSource();
    try{
    Connection conn=GetConncetion.getConnection();
    conn.setAutoCommit(false);
    String insertSQL ="INSERT INTO IMAGE(ID,PIC) VALUES(?,?)";
    PreparedStatement pStmt = conn.prepareStatement(insertSQL);
    pStmt.setInt(1, 1);
    pStmt.setString(2,pic);
    pStmt.execute();
    conn.commit();
    ret = true;
    }catch (SQLException e) {
    System.err.println(e.getMessage());
    } catch (Exception e) {
    System.err.println(e.getMessage());
    return ret;
    and i created one button in Result.amx page and in Action Listener i had given #{bindings.savePicture.execute} and deployed into Android mobile.But i am neither getting error nor getting save picture into database.
    while i run PictureBean.java class alone the following exception occurred.
    "E:\ADF R2\jdk160_24\bin\javaw.exe" -client -classpath "C:\JDeveloper\mywork\DeviceDemo\.adf;C:\JDeveloper\mywork\DeviceDemo\ViewController\classes;E:\OracleJdbc\ojdbc14_g.jar;E:\OracleJdbc\ojdbc14.jar;E:\OracleJdbc\ojdbc.jar;C:\Users\Amar\Downloads\ojdbc6_g.jar;C:\Users\Amar\Downloads\ojdbc6.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-faces-databinding-rt.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\adf-share-support.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-ca.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-base.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\adflogginghandler.jar;E:\ADF R2\oracle_common\modules\oracle.idm_11.1.1\identitystore.jar;E:\ADF R2\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\adfm.jar;E:\ADF R2\oracle_common\modules\groovy-all-1.6.3.jar;E:\ADF R2\oracle_common\modules\oracle.ldap_11.1.1\ojmisc.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\commons-el.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\jsp-el-api.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\oracle-el.jar;E:\ADF R2\oracle_common\modules\oracle.xmlef_11.1.1\xmlef.jar;E:\ADF R2\oracle_common\modules\oracle.bali.share_11.1.1\share.jar;E:\ADF R2\modules\com.bea.core.apache.xercesImpl_2.8.1.jar;E:\ADF R2\modules\javax.activation_1.1.0.0_1-1.jar;E:\ADF R2\modules\javax.mail_1.1.0.0_1-4-1.jar;E:\ADF R2\modules\glassfish.jaxb_1.0.0.0_2-1-12.jar;E:\ADF R2\modules\javax.xml.bind_2.1.1.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\adftransactionsdt.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-dt-at-rt.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\adfdt_common.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\adflibrary.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\db-ca.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\jdev-cm.jar;E:\ADF R2\oracle_common\modules\oracle.adf.security_11.1.1\adf-share-security.jar;E:\ADF R2\oracle_common\modules\oracle.adf.security_11.1.1\adf-controller-security.jar;E:\ADF R2\oracle_common\modules\oracle.adf.share_11.1.1\adfsharembean.jar;E:\ADF R2\oracle_common\modules\oracle.jmx_11.1.1\jmxframework.jar;E:\ADF R2\oracle_common\modules\oracle.jmx_11.1.1\jmxspi.jar;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\bc4j-mbeans.jar;E:\ADF R2\oracle_common\modules\oracle.javatools_11.1.1\resourcebundle.jar;E:\ADF R2\oracle_common\modules\oracle.ldap_11.1.1\ldapjclnt11.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-api.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-common.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-ee.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-internal.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-unsupported-api.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jps-manifest.jar;E:\ADF R2\oracle_common\modules\oracle.jps_11.1.1\jacc-spi.jar;E:\ADF R2\oracle_common\modules\oracle.pki_11.1.1\oraclepki.jar;E:\ADF R2\oracle_common\modules\oracle.osdt_11.1.1\osdt_core.jar;E:\ADF R2\oracle_common\modules\oracle.osdt_11.1.1\osdt_cert.jar;E:\ADF R2\oracle_common\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar;E:\ADF R2\oracle_common\modules\oracle.osdt_11.1.1\osdt_ws_sx.jar;E:\ADF R2\oracle_common\modules\oracle.iau_11.1.1\fmw_audit.jar;E:\ADF R2\modules\javax.security.jacc_1.0.0.0_1-1.jar;E:\ADF R2\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;E:\ADF R2\oracle_common\modules\oracle.mds_11.1.1\oramds.jar;E:\ADF R2\modules\javax.servlet_1.0.0.0_2-5.jar;E:\ADF R2\modules\javax.jsp_1.2.0.0_2-1.jar;E:\ADF R2\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;E:\ADF R2\oracle_common\jlib\commons-cli-1.0.jar;E:\ADF R2\oracle_common\modules\oracle.dms_11.1.1\dms.jar;E:\ADF R2\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;E:\ADF R2\oracle_common\modules\oracle.javacache_11.1.1\cache.jar;E:\ADF R2\oracle_common\modules\oracle.ucp_11.1.0.jar;E:\ADF R2\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;E:\ADF R2\oracle_common\modules\oracle.javatools_11.1.1\javatools-nodeps.jar;E:\ADF R2\modules\javax.management_1.2.1.jar;E:\ADF R2\modules\javax.management.j2ee_1.0.jar;E:\ADF R2\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Users\Amar\Downloads\commons-codec-1.7-bin.zip;C:\Users\Amar\Downloads\commons-codec-1.7-src.zip;E:\ADF R2\oracle_common\modules\oracle.adf.model_11.1.1\dvt-databindings-mds.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\dvt-databindings.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\dvt-facesbindings.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\trinidad-api.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\trinidad-impl.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-api-11.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-impl-11.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-dynamic-faces.jar;E:\ADF R2\oracle_common\modules\oracle.adf.view_11.1.1\adf-faces-changemanager-rt.jar;E:\ADF R2\oracle_common\modules\oracle.facesconfigdt_11.1.1\facesconfigmodel.jar;E:\ADF R2\oracle_common\modules\oracle.facesconfigdt_11.1.1\taglib.jar;E:\ADF R2\modules\glassfish.el_1.0.0.0_2-1.jar;E:\ADF R2\oracle_common\modules\oracle.jsf_2.0\jsf-api.jar;E:\ADF R2\oracle_common\modules\oracle.jsf_2.0\jsf-impl.jar;E:\ADF R2\modules\glassfish.jstl_1.2.0.1.jar;C:\Users\Amar\Downloads\jndi-properties.jar.zip;C:\Users\Amar\Downloads\jndi-1.2.1.jar.zip;C:\Users\Amar\Downloads\h2-1.3.149.jar.zip;C:\Users\Amar\Downloads\Android\h2-1.3.149.zip;C:\Users\Amar\Downloads\Android\android\app;C:\Users\Amar\Downloads\Android\android;C:\Users\Amar\Downloads\Android" -Djavax.net.ssl.trustStore=C:\Users\Amar\AppData\Local\Temp\trustStore7108102737679976193.jks Picture.PictureBean
    Source value is null
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/adfmf/framework/api/AdfmfJavaUtilities
         at Picture.GetConncetion.getConnection(GetConncetion.java:24)
         at Picture.PictureBean.savePicture(PictureBean.java:140)
         at Picture.PictureBean.main(PictureBean.java:189)
    Caused by: java.lang.ClassNotFoundException: oracle.adfmf.framework.api.AdfmfJavaUtilities
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         ... 3 more
    Process exited with exit code 1.
    i already imported AdfmfJavaUtilities package dont know why it showing exception.
    and while i am debugging the GetConnection.java value of 'Dir' is null.i am not getting what is the AdfmfJavaUtilities.ApplicationDirectory?
    Could you help on this!!
    Thanks & Regards
    Amar

  • When capture Picture not clear

    When a capture picture have a .png but all the time the picture not clear??
    I try to correct them with iPhoto but not same like original.
    Mike

    Want to try explain that one again?
    Regards
    TD

  • Webcam capture

    I am using Logitech Quickcam Pro 9000 on my computer and I am
    trying to capture an image size of 533x280. I know it is a non
    standard size. The camera does seem to capture the image at that
    size, but it seems to truncate a lot of the image compared to
    another size that I capture for a different application, the size
    of which is 352x288, which is a standard CIF.
    I have two question based on this observation
    1. if I am streaming the bigger image (with details
    truncated) to FMS, does it transmit more pixels than the truncated
    image that appears on my screen. In short does it transmit more
    than 533x280x30 fps.
    2. Can webcams capture any size (within its outer bounds of
    course) or do they capture only standard sizes that are closest to
    the requested size. Does it make a difference in performance of the
    webcam?
    Thanks

    I would suggest you look at USTREAM. http://www.ustream.tv/
    You can use this free web service to record and broadcast webcam streams from your own computer (or someone else's).
    You can save the streams as an FLV file and then download the FLV to your own computer for editing.  If your bandwidth is reasonable (e.g. 300 kbps) and you use a good quality web cam such as the Logitech C910, which is full HD, you should be able to get excellent video.
    I'm currently using all of this to stream my daughter's wedding tomorrow.

  • Capture picture from stageVideo

    Hi,
    I developed a video conference application and for rendering the video, i want to implement stageVideo API for rendering the video on hardware and also i want to capture picture from stageVideo component, so please guide me for capturing the photo.
    Thanks
    Ram

    Hi,
    Thanks for your interest in StageVideo. The following resources might be useful:
    http://help.adobe.com/en_US/as3/dev/WSe9ecd9e6b89aefd2-68d5ef8f12cc8511f6c-8000.html
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageVideo. html
    http://everythingfla.com/quickies/stageVideo
    http://www.adobe.com/devnet/devices/articles/video_content_tv.html
    Thank you !

  • Picture in Picture tool - Fit/ Crop/ Ken Burns - iMovie

    I have added an image without a background on top of a clip using the Picture in Picture tool - selecting the 'Fit' option instead of the 'Ken Burns' option suddenly gives it a black background. I have successfully done this before so don't know what I'm missing this time.
    Any help would be much appreciated.

    laurenmatkins wrote:
    … an image without a background on top of a clip using the Picture in Picture tool - selecting the 'Fit' option instead of the 'Ken Burns' option suddenly gives it a black background. …
    you're trying to accomplish the 'transparent.png' trick ...
    as described e.g. here
    https://discussions.apple.com/message/21897581#21897581
    prob is: when you just one time only apply fit or KB to that PiP, it is 'poisened'=the transparent areas are irreversible made to black.
    so, a) erase the PiP from your Project timeline
    b)  in Project Properties, in the Timing tab, set "Initial Photo Placement" to "Crop"
    c) try again ...

  • IPhone to image capture picture orientation problem.

    I am having a problem with my iPhone 3G (2.2.1) and pictures. I've seen several other topics about this but none of them address or fix the problem for me (since most of them are from people using other applications like Picasa or iPhoto). Opening up every picture in an image editor and rotating it before syncing back to my iphone is NOT a solution. It's a bandaid.
    Here is the problem.
    Take a picture with iPhone. Connect to Mac. Image Capture app launches and I "Download All" to Pictures folder in Home folder. Images are deleted from the iPhone and moved into the Pictures folder. Opening an image from the Pictures folder opens them in the correct orientation in Preview.
    iTunes is set to import all pictures from the Pictures folder. Sync iPhone. Images are uploaded to the photo library and all of them are rotated 90 degrees CCW. Turning the phone causes the images to rotate automatically to retain "correct orientation" which is still wrong.
    Uploading an image from the phone (to Facebook for example) from the Photo Library results in a rotated image on the server.
    None of the suggestions I've seen so far are a "solution". I don't want to open every image I take in iPhoto and rotate it before I sync it back to my Photo Library.
    My question is how do I fix this, or prevent it from happening? Alternatively, is this a recognized bug that Apple intends to fix?

    This is a useful method to minimize the problem, but it is still not a solution. It is unacceptable that I should have to resort to an extra step using a third party application to get my pictures onto my device, especially considering this problem didn't previously exist.
    I am using all Apple tools (iPhone, iMac, image capture, iTunes) because I want to maintain the integrity of the process.
    I know this problem is related to EXIF information in the image resulting in an unwanted rotation. IF I open an image in another program, I can clearly see that the image dimensions are listed at 1200x1600 (portrait). Either image capture or iTunes is modifying or removing these values before the image is optimized and added to the Photo Library on the phone, resulting in an orientation mismatch.
    I guess I'm going to have to call Apple.

  • Simple Webcam Capture to JPG

    I cannot figure this out.
    All I want to do is write a simple program that will take a still capture from my webcam and save it as a JPG. I don't need any kind of GUI or drawing to the screen. I will be using it in a batch script to take a picture and upload to my website at a fixed interval.
    I have been messing around with it for a long time and have had no success. Here is some code I wrote just now that won't work. I have imported things while trying different pieces of code, but I never took any of them out. That's why I import so many things.
    As you can see, I throw the NoPlayerException and CannotRealizeException. I do not understand why I get these. Also, when I run the program the light on my webcam turns on so I know it's connecting at some level. The file saved test.jpg is not a capture but rather a black square. Is my error in getting the image from the webcam or in writing it onto the BufferedImage so I can the write it to the file?
    Any help would be appreciated.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    import javax.imageio.ImageIO;
    public class wc
         public static Player player = null;
         public static CaptureDeviceInfo di = null;
         public static MediaLocator ml = null;
         public static Buffer buf = null;
         public static Image img = null;
         public static BufferToImage btoi = null;
         public static void main(String[] args) throws IOException, NoPlayerException, CannotRealizeException
              String str = "vfw:Microsoft WDM Image Capture (Win32):0";
              di = CaptureDeviceManager.getDevice(str);
              ml = di.getLocator();
              player = Manager.createRealizedPlayer(ml);
              player.start();
              FrameGrabbingControl fgc = (FrameGrabbingControl)
              player.getControl("javax.media.control.FrameGrabbingControl");
              buf = fgc.grabFrame();
              btoi = new BufferToImage((VideoFormat)buf.getFormat());
              img = btoi.createImage(buf);
              BufferedImage bi = new BufferedImage(160, 120, BufferedImage.TYPE_INT_RGB);
              Graphics2D g2 = bi.createGraphics();
              g2.drawImage(img, null, null);
              File f = new File("test.jpg");
              ImageIO.write(bi, "jpg", f);
    }

    I have a question posted about this code, slightly modified in this thread:
    http://forum.java.sun.com/thread.jspa?threadID=5310154&tstart=0
    Would you check it out, I made a new thread because its not strictly related to this post.

  • Webcam Capture AS2 CS5

    Hey everyone! I'm attempting to use a webcam to capture images (which this does ok) and then overlay the images over eachother with a low opacity.
    The images will be of a users face, each time a new user takes a picture the new face will be overlayed over the old one.
    The first problem is, no matter how much I alter the alpha levels, it does not affect the opacity of the bitmap, I know this is probably simple but I'm fairly new to actionscripting!
    Also the next step is figuring out how to get the image to stay there once the next one has been taken. I was wondering am I right in thinking of dynamically creating a new movieclip for each bitmap taken and changing the alpha of the movie clip. Would this work as a solution of both problems?
    Many thanks for any help!
    [CODE]import flash.display.BitmapData;
    import com.adobe.images.JPGEncoder;
    var snd:Sound = new camerasound();
    var bandwidth:int = 0;
    var quality:int = 100;
    var cam:Camera = Camera.getCamera();
    cam.setQuality(bandwidth, quality);
    cam.setMode(320,240,30,false);
    var video:Video = new Video();
    video.attachCamera(cam);
    video.x = 20;
    video.y = 20;
    video.alpha = 10;
    addChild(video);
    var bitmapData:BitmapData = new BitmapData(video.width,video.height);
    var bitmap:Bitmap = new Bitmap(bitmapData);
    bitmap.x = 360;
    bitmap.y = 20;
    addChild(bitmap);
    capture_mc.buttonMode = true;
    capture_mc.addEventListener(MouseEvent.CLICK,captureImage);
    function captureImage(e:MouseEvent):void {
    snd.play();
    bitmapData.draw(video);
    save_mc.buttonMode = true;
    save_mc.addEventListener(MouseEvent.CLICK, onSaveJPG);
    save_mc.alpha = 10;
    save_mc.alpha = 10;
    function onSaveJPG(e:Event):void{
    var myEncoder:JPGEncoder = new JPGEncoder(100);
    var byteArray:ByteArray = myEncoder.encode(bitmapData);
    var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
    var saveJPG:URLRequest = new URLRequest("save.php");
    saveJPG.requestHeaders.push(header);
    saveJPG.method = URLRequestMethod.POST;
    saveJPG.data = byteArray;
    var urlLoader:URLLoader = new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, sendComplete);
    urlLoader.load(saveJPG);
    function sendComplete(event:Event):void{
    warn.visible = true;
    addChild(warn);
    warn.addEventListener(MouseEvent.MOUSE_DOWN, warnDown);
    warn.buttonMode = true;
    function warnDown(e:MouseEvent):void{
    navigateToURL(new URLRequest("images/"), "_blank");
    warn.visible = false;
    warn.visible = false;[/CODE]

    enderwiggin wrote:
    So it turns out that so many of these cameras update at such a slow rate (or are dead/static) that the system (which only captures most of these cameras once every 30 minutes) does end up downloading duplicates. That does surprise me since I would have expected thermal noise to change some pixels.
    When I originally wrote this I had it saving the images to disk and then checking them, but it was almost impossible to delete the file successfully if the image was determined to be a duplicate. I don't understand this. I don't see how having a duplicate file can in any way influence a 'delete'.
    >
    Rather than save in a ByteArrayOutputStream why not just compare the bytes in the buffer just read with those on the disk. I'm up for trying anything at this point, but I'm having a hard time figuring out how to go about this.Since after every buffer read you know how many bytes have just been read, using a RandomAccess file you can read that number from the file and compare them. If they are different then you change to just writing the new byte directly using the RandomAccess file.
    Ideally, what I need is to read the image into just an array of bytes that I can compare against the last image and then write to disk. Which, as you are finding out, does not scale. Reading the whole of a file into memory is rarely a good idea.
    I'm turning around and passing the array of bytes to another method by way of out.toByteArray() to do the check. By the way I'm limiting the number of simultaneous captures to 10, which works well it seems for most of the program's operation. So put the requests for capture into a priority queue and then process the queue using a finite pool of tasks.
    >
    As a note, I've already tried bumping up the JVM's allocated memory with no luck.... although that would've been a pretty poor long term solution anyways.Yep. If I have to allocate more memory then my solution is poor.

  • Webcam capture & save as JPEG image

    Hi,
    I'm creating an application to capture image via webcam using directshow. I've managed to capture the stream using samplegrabber.
    the problem is when I save the grabbed image to a JPEG, the colors are incorrect.
    provided the link of the captured image from the webcam http://www.filefreak.com/pfiles/44160/test2.jpg
    the right hand side of the image should be brown colored, not blue as in the picture.
    I've also test to save as a bmp image, the color are ok.
    this is how i save the grabbed webcam frame into a jpeg file
    sampleGrabber->GetCurrentBuffer(&bufferSize, (long*)frameBuffer); 
    //save into jpeg 
    struct jpeg_compress_struct cinfo; 
    struct jpeg_error_mgr jerr; 
    JSAMPLE * image_buffer=NULL; 
    FILE * outfile;      
    JSAMPROW row_pointer[1];     
    int row_stride;  
    cinfo.err = jpeg_std_error(&jerr); 
    jpeg_create_compress(&cinfo); 
    if ((outfile = fopen("test2.jpg", "wb")) == NULL) { 
            fprintf(stderr, "can't open %s\n", "test2.jpg"); 
        return; 
    image_buffer = (unsigned char*)frameBuffer; 
    jpeg_stdio_dest(&cinfo, outfile); 
    cinfo.image_width = videoWidth;      
    cinfo.image_height = videoHeight; 
    cinfo.input_components = 3;      
    cinfo.in_color_space = JCS_RGB;      
    jpeg_set_defaults(&cinfo); 
    jpeg_set_quality(&cinfo, 255, TRUE ); 
    jpeg_start_compress(&cinfo, TRUE); 
    row_stride = videoWidth * 3;     
    while (cinfo.next_scanline < cinfo.image_height) { 
        row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride]; 
        (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); 
    jpeg_finish_compress(&cinfo); 
    fclose(outfile); 
    jpeg_destroy_compress(&cinfo); 
    //end save jpeg 
    Thanks.
    Regards

    Hi,
    Thanks
    for participating on the MSDN Forum! I think your question is mainly related
    with DirectX, but not Visual C++ Language. Thus, I suggest you post your
    question on the microsoft.public.win32.programmer.directx.video newsgroup, there you find DirectX experts and your
    question should be answered in no time.
    The people there will have enough experience with DirectX to give you the best
    advice or answer!
    http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.win32.programmer.directx.video&lang=en&cr=US
    Thanks! Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Webcame Capture Problem

    Hello,
    I am trying to take pictures from webcam throw Labview , Labview can detect the camera but the problem is that it doesn't capture and display the picture
    I have installed the IMAQ USB driver and I have tried 3 types of webcames but the same broblem is present
    I have used the Labview webcame Library,
    and also the example attached
    Can any help me solving this Problem ?
    Thank you
    Mar-Q
    Attachments:
    Acquire a USB Camera Image 1.vi ‏73 KB

    Hi qurrr,
    Your VI worked fine on my system with my Creative Live! USB camera without requiring any modifications. Are you getting any errors when you try to access your camera?
    Are your USB cameras DirectShow compliant? They need to be in order to access them using IMAQ for USB (for example, is the "USB Camera" string indicator you have on the front panel filling in with the name of your camera OK?).
    Another possibility is that your are disabling the "snapshot" property of the Image Viewer on your front panel, but in the VI you posted it was still enabled properly. If it was disabled, then when you dispose of the image, it would clear the image display because they would both be pointing to the same space in memory. Please take a look at the following KnowledgeBase articles to see what I mean there:
    KB 3NDH344Y: IMAQ Image Display Indicator Changes Throughout Execution of VI
    KB 3NRFH84Y: Image Display Refreshing in LabVIEW
    To ensure your image display would be updated before your dispose is called, you could change your simple VI to be like the screenshot I've included, where you put the display indicator in a flat sequence with the IMAQ USB Close VI, so that you force it to get called before the IMAQ Dispose VI.
    Message Edited by VGA CD-ROM on 02-27-2008 03:10 PM
    Regards,
    Vijay S.
    National Instruments
    Attachments:
    display_in_sequence.gif ‏8 KB

Maybe you are looking for

  • Install Windows 8 on Pavilion 20

    Hi I have a Pavilion 20 that stuck on HP logo, so I need to reinstall Window 8. How can I do it?

  • How To Read and Write with Listbox

    Looking for a simple example on how to write data into a Listbox via my Block Diagram. That indicates to me that my Listbox needs to be an Indicator (so I can write to it). But, if my operator selects one of the items from the Listbox, I want to be a

  • HT202157 ATV3: How to set audio out to SPDIF?

    After updating the Apple TV3 to software version 5.2.1 my amplifier no longer plays the music that should be coming from the Apple TV. I did nothing with the wiring or cables, the only thing that changed is the software update, everything worked fine

  • May I know how to use the user event

    I saw a sample as the attached screen. The user event is used. I am totally new of user event. may you give a brief explanation of it and how it used. Thanks. Attachments: Event.JPG ‏195 KB

  • What are the premier file types

    I see a lot of rendered file types in my disk directory after several editing sessions. I also see several types of files like pek, cfa, xmp. Is there somewhere that I can find the file types? I'm trying to clean up my directories but am concerned ab