Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: The type of *this Pin
George_George15-Dec-07 22:40
George_George15-Dec-07 22:40 
Questionreturn reference to local variable, good code? Pin
George_George15-Dec-07 18:46
George_George15-Dec-07 18:46 
AnswerRe: return reference to local variable, good code? Pin
Rajasekharan Vengalil15-Dec-07 20:38
Rajasekharan Vengalil15-Dec-07 20:38 
GeneralRe: return reference to local variable, good code? Pin
George_George15-Dec-07 21:31
George_George15-Dec-07 21:31 
QuestionHow to get Instance of Main Window from MFC Activex Pin
ashishbhatt15-Dec-07 18:45
ashishbhatt15-Dec-07 18:45 
AnswerRe: How to get Instance of Main Window from MFC Activex Pin
Mike Dimmick16-Dec-07 1:37
Mike Dimmick16-Dec-07 1:37 
GeneralRe: How to get Instance of Main Window from MFC Activex Pin
ashishbhatt16-Dec-07 2:00
ashishbhatt16-Dec-07 2:00 
GeneralGDI+ Alpha changed, the image is still opaque why? [modified] Pin
followait15-Dec-07 18:01
followait15-Dec-07 18:01 
Bitmap *pbm=::new Bitmap(rt.Width,rt.Height,bm.GetPixelFormat());
Graphics *pg=::new Graphics(pbm);
pg->SetInterpolationMode(InterpolationModeHighQuality);
pg->DrawImage(&bm,0,0,rt.Width,rt.Height);


//locked this way
pbm->LockBits(&Rect(0,0,rt.Width,rt.Height),ImageLockModeRead|ImageLockModeWrite,PixelFormat32bppARGB,&bmd);
...
//r,g,b can be changed normally. a can't. why?
pClr->SetValue(Color::MakeARGB(100,0xff,pClr->GetGreen(),pClr->GetBlue()));
//trace here, a is 100
a=pClr->GetAlpha();

//UnlockBits is also called


I used ImageAttributes to roate and adjust intensity when drawing.
Here is the code:
Matrix NM;
PointF fpt((float)pCB->m_Center.X,(float)pCB->m_Center.Y);
NM.RotateAt(pCB->m_Angle,fpt);
Matrix  OM;
m_pMemGraphics->GetTransform(&OM);
m_pMemGraphics->SetTransform(&NM);

ColorMatrix cm = {
    1.0f,0.0f,0.0f,0.0f,0.0f,
    0.0f,1.0f,0.0f,0.0f,0.0f,
    0.0f,0.0f,1.0f,0.0f,0.0f,
    0.0f,0.0f,0.0f,1.0f,0.0f,
    pCB->m_IntensityAdjust,pCB->m_IntensityAdjust,pCB->m_IntensityAdjust,0.f,1.0f
};
ImageAttributes ImAtt;
ImAtt.SetColorMatrix( &cm,ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
m_pMemGraphics->DrawImage(pbm,rt,0,0,rt.Width,rt.Height,UnitPixel,&ImAtt);

modified on Sunday, December 16, 2007 12:08:59 PM

GeneralRe: GDI+ Alpha changed, the image is still opaque why? Pin
Mark Salsbery16-Dec-07 6:25
Mark Salsbery16-Dec-07 6:25 
GeneralRe: GDI+ Alpha changed, the image is still opaque why? Pin
followait16-Dec-07 6:29
followait16-Dec-07 6:29 
GeneralGDI+ how to do bitmap mask efficiently Pin
followait15-Dec-07 16:07
followait15-Dec-07 16:07 
GeneralRe: GDI+ how to do bitmap mask efficiently Pin
Christian Graus15-Dec-07 16:15
protectorChristian Graus15-Dec-07 16:15 
GeneralRe: GDI+ how to do bitmap mask efficiently Pin
Mark Salsbery16-Dec-07 6:33
Mark Salsbery16-Dec-07 6:33 
GeneralRe: GDI+ how to do bitmap mask efficiently Pin
followait16-Dec-07 15:24
followait16-Dec-07 15:24 
QuestionImbed C++ Code Pin
BRIMID15-Dec-07 13:48
BRIMID15-Dec-07 13:48 
GeneralRe: Imbed C++ Code Pin
Christian Graus15-Dec-07 13:50
protectorChristian Graus15-Dec-07 13:50 
QuestionPreventing an Invalid Entry Pin
BRIMID15-Dec-07 13:45
BRIMID15-Dec-07 13:45 
GeneralRe: Preventing an Invalid Entry Pin
Nelek16-Dec-07 22:14
protectorNelek16-Dec-07 22:14 
QuestionHow do you increase memory allocation during class initialization? [modified] Pin
gluballs15-Dec-07 12:15
gluballs15-Dec-07 12:15 
GeneralRe: How do you increase memory allocation during class initialization? Pin
Mike Dimmick15-Dec-07 14:18
Mike Dimmick15-Dec-07 14:18 
GeneralIO stream manipulators inside a class Pin
Lutosław15-Dec-07 10:13
Lutosław15-Dec-07 10:13 
GeneralRe: IO stream manipulators inside a class Pin
Mike Dimmick15-Dec-07 15:01
Mike Dimmick15-Dec-07 15:01 
GeneralRe: IO stream manipulators inside a class Pin
Lutosław16-Dec-07 8:43
Lutosław16-Dec-07 8:43 
GeneralChallenging Visual Programing Code Required Pin
Moon009215-Dec-07 7:37
Moon009215-Dec-07 7:37 
GeneralRe: Challenging Visual Programing Code Required Pin
Mike Dimmick15-Dec-07 7:45
Mike Dimmick15-Dec-07 7:45 

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.