Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMac and IP address problem Pin
trioum3-Mar-11 5:14
trioum3-Mar-11 5:14 
QuestionRe: Mac and IP address problem Pin
David Crow3-Mar-11 5:33
David Crow3-Mar-11 5:33 
AnswerRe: Mac and IP address problem Pin
trioum3-Mar-11 6:11
trioum3-Mar-11 6:11 
QuestionRe: Mac and IP address problem Pin
David Crow3-Mar-11 7:25
David Crow3-Mar-11 7:25 
QuestionHow to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Amrit Agr2-Mar-11 22:40
Amrit Agr2-Mar-11 22:40 
AnswerRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Richard MacCutchan3-Mar-11 2:08
mveRichard MacCutchan3-Mar-11 2:08 
AnswerRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Andrew Brock3-Mar-11 2:31
Andrew Brock3-Mar-11 2:31 
GeneralRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Amrit Agr3-Mar-11 16:59
Amrit Agr3-Mar-11 16:59 
Actually there is one Picture In Picture( PIP ) module in the application. There is a shadow functionality is available with masking for the front layer. My mask( like heart shape ) is a bitmap file ( of 32 bpp ) which is put in the place of front layer( picture ). It's shadow looks like the same.

We can give shadow color of my choice as well( it is a provision ). Shadow will have selected color. So as it should be shown a transparent look I have used AlphaBlend() function to show transparent and semi-transparent pixels present in mask bitmap.

For the BLENDFUNCTION structure( m_blendfunc ) I given at Initialization
m_blendfunc.BlendOp = AC_SRC_OVER;
m_blendfunc.BlendFlags = 0;
m_blendfunc.SourceConstantAlpha = 0;
m_blendfunc.AlphaFormat = AC_SRC_ALPHA;

We can change the intensity of shadow as well( it's a provision ). It's rage from 0 to 100.

So that In OnPaint() I have changed the SCA value as per intenisty value.
m_blendfunc.SourceConstantAlpha = int( m_intensity * 2.55 );

As per the MSDN I have taken the red, green, blue and alpha value from Source( mask bitmap ) and mix up with destination colors ( of selected shadow color ) by this type of calculation

Src.Red = Src.Red * SourceConstantAlpha / 255.0;
Src.Green = Src.Green * SourceConstantAlpha / 255.0;
Src.Blue = Src.Blue * SourceConstantAlpha / 255.0;
Src.Alpha = Src.Alpha * SourceConstantAlpha / 255.0;
Dst.Red = Src.Red + (1 - Src.Alpha) * Dst.Red
Dst.Green = Src.Green + (1 - Src.Alpha) * Dst.Green
Dst.Blue = Src.Blue + (1 - Src.Alpha) * Dst.Blue
Dst.Alpha = Src.Alpha + (1 - Src.Alpha) * Dst.Alpha

The shadow is not getting proper it's look like some type of animation when I change the intesity.

Are I am making any mistake for taking source and destination colors or there is some mistake in calculation of new colors.

I have tried ur suggetsion of iterating through bitmap height & width but the result is same.
QuestionUnicode Representation and Transformation Pin
pix_programmer2-Mar-11 21:48
pix_programmer2-Mar-11 21:48 
AnswerRe: Unicode Representation and Transformation Pin
Richard MacCutchan2-Mar-11 23:03
mveRichard MacCutchan2-Mar-11 23:03 
GeneralRe: Unicode Representation and Transformation Pin
pix_programmer3-Mar-11 0:21
pix_programmer3-Mar-11 0:21 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 1:51
mveCPallini3-Mar-11 1:51 
GeneralRe: Unicode Representation and Transformation Pin
Richard MacCutchan3-Mar-11 2:00
mveRichard MacCutchan3-Mar-11 2:00 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 2:18
mveCPallini3-Mar-11 2:18 
GeneralRe: Unicode Representation and Transformation Pin
Richard MacCutchan3-Mar-11 3:17
mveRichard MacCutchan3-Mar-11 3:17 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 3:28
mveCPallini3-Mar-11 3:28 
AnswerRe: Unicode Representation and Transformation Pin
Nemanja Trifunovic3-Mar-11 3:45
Nemanja Trifunovic3-Mar-11 3:45 
QuestionUnhandled exception at EndDialog. Pin
Le@rner2-Mar-11 17:29
Le@rner2-Mar-11 17:29 
AnswerRe: Unhandled exception at EndDialog. Pin
«_Superman_»2-Mar-11 20:18
professional«_Superman_»2-Mar-11 20:18 
GeneralRe: Unhandled exception at EndDialog. Pin
Le@rner2-Mar-11 20:32
Le@rner2-Mar-11 20:32 
GeneralRe: Unhandled exception at EndDialog. Pin
«_Superman_»2-Mar-11 20:35
professional«_Superman_»2-Mar-11 20:35 
GeneralRe: Unhandled exception at EndDialog. Pin
Le@rner2-Mar-11 20:35
Le@rner2-Mar-11 20:35 
GeneralRe: Unhandled exception at EndDialog. Pin
Cool_Dev2-Mar-11 21:10
Cool_Dev2-Mar-11 21:10 
GeneralRe: Unhandled exception at EndDialog. Pin
Le@rner2-Mar-11 21:18
Le@rner2-Mar-11 21:18 
QuestionRe: Unhandled exception at EndDialog. Pin
David Crow3-Mar-11 2:39
David Crow3-Mar-11 2:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.