Click here to Skip to main content
15,909,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Exception Pin
CPallini12-Dec-10 22:30
mveCPallini12-Dec-10 22:30 
AnswerRe: Exception Pin
MsmVc12-Dec-10 22:59
MsmVc12-Dec-10 22:59 
QuestionDear buddy, I am mad, can you help me and don't drop me as sacrifice Pin
nenfa12-Dec-10 16:58
nenfa12-Dec-10 16:58 
AnswerRe: Dear buddy, I am mad, can you help me and don't drop me as sacrifice Pin
nenfa14-Dec-10 15:09
nenfa14-Dec-10 15:09 
QuestionCan not delete multiple files with ReadDirectoryChangesW Pin
ShadowUz12-Dec-10 13:30
ShadowUz12-Dec-10 13:30 
AnswerRe: Can not delete multiple files with ReadDirectoryChangesW Pin
Luc Pattyn12-Dec-10 14:12
sitebuilderLuc Pattyn12-Dec-10 14:12 
QuestionRe: Can not delete multiple files with ReadDirectoryChangesW Pin
David Crow13-Dec-10 3:16
David Crow13-Dec-10 3:16 
QuestionCreate Bitmap from mousemovement in picturebox MFC Pin
josipahutar12-Dec-10 9:48
josipahutar12-Dec-10 9:48 
hi guys,,,

i'm have a project about MFC. how to create bitmap from mousemovent??
for mousemovent i'm can write to picturebox.
the code is written in mfc wizard exe in a dialog based application.

for picturebox -> IDC_PIC
for button -> IDC_SAVE

my code:

void CSignature1Dlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_pic1.GetSafeHwnd();
HCURSOR hcur = NULL;
CRect rc;
m_pic1.GetClientRect(&rc);
rc.NormalizeRect();

rc.left=0;
rc.right=250;
rc.top=0;
rc.bottom=250;

POINT MousePosition = point;

BOOL isOnPictureControl = PtInRect(&rc, MousePosition);

if((m_iPrevX >=rc.left && m_iPrevX <=rc.right) && (m_iPrevY >=rc.top && m_iPrevY <=rc.bottom )){
if((nFlags & MK_LBUTTON) == MK_LBUTTON)
{
CDC* pDC = m_pic1.GetDC();
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
dcMem.SelectObject(&m_bmpBitmap);
CPen pen (PS_SOLID,2,RGB(0,0,0));
pDC->SelectObject (&pen);
pDC->MoveTo(m_iPrevX,m_iPrevY);
pDC->LineTo(point.x,point.y);
pDC->SetPixel(point.x,point.y, RGB(0,0,0)) ;
m_iPrevX=point.x;
m_iPrevY=point.y;



}

}




CDialog::OnMouseMove(nFlags, point);
}

void CSignature1Dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
HCURSOR hcur = NULL;
CRect rc;
m_pic1.GetClientRect(&rc);
rc.NormalizeRect();

m_iPrevX=point.x;
m_iPrevY=point.y;

CDialog::OnLButtonDown(nFlags, point);
}

void CSignature1Dlg::OnSave()
{
// TODO: Add your control notification handler code here

?????????
}


so give me advice, how to can create and save the mousemovent into bitmap??? Confused | :confused:
i hope u can help me... Hmmm | :|
AnswerRe: Create Bitmap from mousemovement in picturebox MFC Pin
Alain Rist12-Dec-10 10:00
Alain Rist12-Dec-10 10:00 
GeneralRe: Create Bitmap from mousemovement in picturebox MFC Pin
josipahutar13-Dec-10 7:21
josipahutar13-Dec-10 7:21 
GeneralRe: Create Bitmap from mousemovement in picturebox MFC Pin
David Crow13-Dec-10 8:01
David Crow13-Dec-10 8:01 
GeneralRe: Create Bitmap from mousemovement in picturebox MFC Pin
Alain Rist13-Dec-10 9:20
Alain Rist13-Dec-10 9:20 
Question[Solved] Speech sample not running.... [modified] Pin
AmbiguousName12-Dec-10 8:01
AmbiguousName12-Dec-10 8:01 
AnswerRe: Speech sample not running.... Pin
Richard MacCutchan12-Dec-10 9:37
mveRichard MacCutchan12-Dec-10 9:37 
AnswerRe: Speech sample not running.... Pin
Emilio Garavaglia12-Dec-10 9:42
Emilio Garavaglia12-Dec-10 9:42 
QuestionUsing Filtering Functions in Win32 App Pin
Coder-12345612-Dec-10 3:14
Coder-12345612-Dec-10 3:14 
AnswerRe: Using Filtering Functions in Win32 App Pin
Niklas L12-Dec-10 3:23
Niklas L12-Dec-10 3:23 
GeneralRe: Using Filtering Functions in Win32 App Pin
Coder-12345612-Dec-10 5:07
Coder-12345612-Dec-10 5:07 
GeneralRe: Using Filtering Functions in Win32 App Pin
Niklas L12-Dec-10 8:09
Niklas L12-Dec-10 8:09 
GeneralRe: Using Filtering Functions in Win32 App Pin
Coder-12345612-Dec-10 21:27
Coder-12345612-Dec-10 21:27 
QuestionHow can use Socket Connection Timeout? Pin
Le@rner11-Dec-10 1:40
Le@rner11-Dec-10 1:40 
AnswerRe: How can use Socket Connection Timeout? Pin
yu-jian15-Dec-10 3:13
yu-jian15-Dec-10 3:13 
GeneralRe: How can use Socket Connection Timeout? Pin
Le@rner15-Dec-10 17:19
Le@rner15-Dec-10 17:19 
QuestionUser defined message , exeption at the handler return [modified] Pin
timbk10-Dec-10 3:05
timbk10-Dec-10 3:05 
AnswerRe: User defined message , exeption at the hander return Pin
Cool_Dev10-Dec-10 3:25
Cool_Dev10-Dec-10 3:25 

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.