This would be a recursive type: "A function that returns a function that returns a function that ...". You can't do that!
The question now is what you want to achieve with that? To me that code looks rather obfuscated, making it error prone and hard to maintain. The sequence of function calls is encoded in the function implementations, rather in the implementation of the calling function. This is not only breaking the concept of encapsulation, it is also prone to mistakes causing endless loops, and later changes such as introducing more of these functions or changing the sequence will be very hard.
Why do you not simply write a sequence of function calls instead?
I have two types of app that should use this concept:
1.)A sort of scripting language that drives big image processing routines where the next result is only decided on the basis of execution. So these things are a sort of super high-level assembly language in which instructions do not have locations, but which perform a jump as part of every instruction.
2.)Breaking down really big scientific executions so that they may be executed in fragments witin OnIdle etc.....
1) Make an interpreter that analyzes the script and determines which function to call next.
2) Just split the execution into individual parts and call them sequentially. If the individual parts work or continue to work on a common context, make a struct to hold that context and pass a pointer to that as a parameter to each part-function.
In both cases there is no reason at all to encode the sequence of function calls right into the functions themselves. In fact, it would be bad to do so, for the very reasons pointed out above.
I use AlphaBlend blend the src( 0, 255, 0, 0 ) on dst( 128,128,128 ),expecting the result color should be the same as the dst( 128, 128, 128 ). But the result is ( 255, 128, 128 ). I have spent 5 hours try to find something, but unluckily I find nothing. it drives me crazy.
Could someon help me?
BlendFunction.BlendOp = AC_SRC_OVER
.blendflag = 0
.SCA = 255
.AlphaFormat = AC_SRC_ALPHA
My bmp is per-pixel alpha channel bitmap.
I googled something articles and turuned out I didn't do the premultiple, but I am still comfused with the following formula:
Dst.Red = Src.Red + (1 - Src.Alpha) * Dst.Red
where the Src.alpha's value making sense should be 0.0 - 1.0, but it is 0 - 255. I wonder OS translate the alpha value in background for us?
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn.
SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border,
I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks.
the code as follow: