Error 'Blending::Blend': non-standard syntax; use '&' to create a pointer to member

Am having a function called "createtrackbar" that takes a function
with a pointer argument as argument, am calling the the function
am passing to createtrackbar is called Blend from the same class.. this is how i called the function..
This is the Blend function in its cpp file....

1
2
3
4
5
6
7
8
9
10
11
void Blending::Blend(int, void*)
	{
		alpha = (double)defaultvalue / 100;
		addWeighted(img, alpha, img2, 1.0 - alpha, 0, des);
		imshow("Blendimage", des);
	
}

int main
{
			
Blending ble;
			
Blend(defaultvalue, 0);
			
Blend(defaultvalue, 0);
createTrackbar("Blend", "Blendimage", &defaultvalue, maximumvalue,ble.Blend);
}


so please what am i doing wrong, and how to correct it, thanks in advance...









Last edited on
in your main
createTrackbar("Blend", "Blendimage", &defaultvalue, maximumvalue,ble.Blend);
You're trying to call the function Blend(int, void*) but you didn't use the parentheses and you didn't pass the function's arguments within them

I suppose what you wanted to do was that:
createTrackbar("Blend", "Blendimage", &defaultvalue, maximumvalue, ble.Blend(defaultvalue, 0));
Last edited on
Topic archived. No new replies allowed.