Example #1
0
static void Init_RhoBlobs()
{
    const char* szBlobPath = rho_rhodesapp_getblobsdirpath();
    const char* szUserPath = rho_native_rhodbpath();
    RAWLOG_INFO1("Init_RhoBlobs: %s", szBlobPath );

    rho_file_recursive_createdir(szBlobPath, szUserPath);
}
Example #2
0
HRESULT Camera::takePicture(HWND hwndOwner,LPTSTR pszFilename) 
{
    HRESULT         hResult = S_OK;
#if defined(_WIN32_WCE) //&& !defined( OS_PLATFORM_MOTCE )
	if(RHO_IS_WMDEVICE)
	{
		SHCAMERACAPTURE shcc;

		StringW imageDir;
		convertToStringW(rho_rhodesapp_getblobsdirpath(), imageDir);

		StringW strFileName = generate_filename(L".jpg");

		// Set the SHCAMERACAPTURE structure.
		ZeroMemory(&shcc, sizeof(shcc));
		shcc.cbSize             = sizeof(shcc);
		shcc.hwndOwner          = hwndOwner;
		shcc.pszInitialDir      = imageDir.c_str();
		shcc.pszDefaultFileName = strFileName.c_str();
		shcc.pszTitle           = TEXT("Camera");
		shcc.VideoTypes			= CAMERACAPTURE_VIDEOTYPE_MESSAGING;
		shcc.nResolutionWidth   = 176;
		shcc.nResolutionHeight  = 144;
		shcc.StillQuality       = CAMERACAPTURE_STILLQUALITY_LOW;
		shcc.nVideoTimeLimit    = 15;
		shcc.Mode               = CAMERACAPTURE_MODE_STILL;

		// Display the Camera Capture dialog.
		hResult = lpfn_Camera_Capture(&shcc);

		// The next statements will execute only after the user takes
		// a picture or video, or closes the Camera Capture dialog.
		if (S_OK == hResult) 
		{
			LOG(INFO) + "takePicture get file: " + shcc.szFile;

			LPTSTR fname = get_file_name( shcc.szFile, imageDir.c_str() );
			if (fname) {

				StringCchCopy( pszFilename, MAX_PATH, fname );
				free(fname);
			} else {
				LOG(ERROR) + "takePicture error get file: " + shcc.szFile;

				hResult = E_INVALIDARG;
			}
		}else
		{
			LOG(ERROR) + "takePicture failed with code: " + LOGFMT("0x%X") + hResult;
		}
	}
#endif //_WIN32_WCE

    return hResult;
}
Example #3
0
static void Init_RhoBlobs()
{
  VALUE path = rb_str_new2(rho_rhodesapp_getblobsdirpath());

  RAWLOG_INFO1("Init_RhoBlobs: %s", RSTRING_PTR(path) );

  if ( rb_funcall(rb_cDir, rb_intern("exist?"), 1, path)==Qfalse )
    rb_funcall(rb_cDir, rb_intern("mkdir"), 1, path);

  RAWLOG_INFO("Init_RhoBlobs: done");
}
Example #4
0
HRESULT Camera::takePicture(HWND hwndOwner,LPTSTR pszFilename) 
{
    HRESULT         hResult = S_OK;
#if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
    SHCAMERACAPTURE shcc;

    StringW root;
    convertToStringW(rho_rhodesapp_getblobsdirpath(), root);
    wsprintf( pszFilename, L"%s", root.c_str() );

	create_folder(pszFilename);

    //LPCTSTR szExt = wcsrchr(pszFilename, '.');
    TCHAR filename[256];
	generate_filename(filename,L".jpg");

    // Set the SHCAMERACAPTURE structure.
    ZeroMemory(&shcc, sizeof(shcc));
    shcc.cbSize             = sizeof(shcc);
    shcc.hwndOwner          = hwndOwner;
    shcc.pszInitialDir      = pszFilename;
    shcc.pszDefaultFileName = filename;
    shcc.pszTitle           = TEXT("Camera");
    shcc.VideoTypes			= CAMERACAPTURE_VIDEOTYPE_MESSAGING;
    shcc.nResolutionWidth   = 176;
    shcc.nResolutionHeight  = 144;
    shcc.nVideoTimeLimit    = 15;
    shcc.Mode               = CAMERACAPTURE_MODE_STILL;

    // Display the Camera Capture dialog.
    hResult = SHCameraCapture(&shcc);

    // The next statements will execute only after the user takes
    // a picture or video, or closes the Camera Capture dialog.
    if (S_OK == hResult) {
        LPTSTR fname = get_file_name(shcc.szFile,pszFilename);
		if (fname) {
			StringCchCopy(pszFilename, MAX_PATH, fname);
			free(fname);
		} else {
            LOG(ERROR) + "takePicture error get file: " + shcc.szFile;

			hResult = E_INVALIDARG;
		}
    }else
    {
        LOG(ERROR) + "takePicture failed with code: " + LOGFMT("0x%X") + hResult;
    }
#endif //_WIN32_WCE

    return hResult;
}