示例#1
0
static int w32gdi_set_temperature(int temp, /*@unused@*/ gamma_s gamma)
{
	gamma_ramp_s ramp=gamma_ramp_fill(GAMMA_RAMP_SIZE,temp);

	/* Set new gamma ramps */
	if( (!state.hDC)||(!ramp.all) ){
		LOG(LOGERR,_("No device context or ramp."));
		return RET_FUN_FAILED;
	}
	if( !SetDeviceGammaRamp(state.hDC,ramp.all)) {
		LOG(LOGERR,_("Unable to set gamma ramps."));
		return RET_FUN_FAILED;
	}

	return RET_FUN_SUCCESS;
}
示例#2
0
static int w32gdi_set_temperature(int temp, /*@unused@*/ gamma_s gamma)
{
	HDC hdc;
	gamma_ramp_s ramp=gamma_ramp_fill(GAMMA_RAMP_SIZE,temp);

	/* Set new gamma ramps */
	hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);
	if( (!hdc)||(!ramp.all) ){
		LOG(LOGERR,_("No device context or ramp."));
	    (void)DeleteDC(hdc);
		return RET_FUN_FAILED;
	}

	if( !SetDeviceGammaRamp(hdc,ramp.all)) {
		LOG(LOGERR,_("Unable to set gamma ramps."));
	    (void)DeleteDC(hdc);
    }

	(void)DeleteDC(hdc);
	return RET_FUN_SUCCESS;
}