Click here to Skip to main content
15,922,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalbut Pin
realfly17-Mar-02 20:53
realfly17-Mar-02 20:53 
GeneralRe: but Pin
Mazdak17-Mar-02 21:14
Mazdak17-Mar-02 21:14 
Generallet me try it8) Pin
realfly17-Mar-02 21:23
realfly17-Mar-02 21:23 
Generalhow to buffer it, it looks flicker! Pin
realfly18-Mar-02 3:55
realfly18-Mar-02 3:55 
GeneralRe: how to buffer it, it looks flicker! Pin
Mazdak18-Mar-02 4:12
Mazdak18-Mar-02 4:12 
AnswerRe: How can i draw a draged line when mouse move in gdi+? Pin
Christian Graus17-Mar-02 21:05
protectorChristian Graus17-Mar-02 21:05 
Generali'd like to try the "double buffer" Pin
realfly17-Mar-02 21:21
realfly17-Mar-02 21:21 
Generalhow to buffer it? it looks flicker! Pin
realfly18-Mar-02 14:29
realfly18-Mar-02 14:29 
That 's what i done:

Bitmap *m_image; /*for draw line, which will combined with the background*/
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if ( IsWindow() == false )
return 0;
PAINTSTRUCT ps;

// Start a paint session and create a graphics object.
BeginPaint(&ps);

Graphics *g1 = Graphics::FromImage(m_image);
g1->Clear(Color(Color::White));
Pen p(Color(255, 0, 0, 0), 5);

g1->DrawLine(&p, 0,0, LOWORD(lParam), HIWORD(lParam));
EndPaint(&ps);

//combine the line with the background
BeginPaint(&ps);
Graphics g2(GetDC());
ImageAttributes imageAttr;
Status stat = imageAttr.SetColorKey(Color::White,
Color::White,
ColorAdjustTypeDefault);

CRect rect;
GetWindowRect(&rect);
if ( !m_image )
m_image = new Bitmap(rect.Width(), rect.Height());
Rect rc;
RedrawWindow(); //call OnPaint to draw the background
g2.DrawImage(m_image,
Rect(0, 0, m_image->GetWidth(),
m_image->GetHeight()),
0, 0, m_image->GetWidth(), m_image->GetHeight(),
UnitPixel, &imageAttr, NULL, NULL);
EndPaint(&ps);

return 0;
}

LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
//here i draw a picture as the background
}
it seems that i must redraw all the window when the mouse moving, thus comes with the flicker. can it be avoided?


i ma realfly
GeneralRe: how to buffer it? it looks flicker! Pin
Christian Graus18-Mar-02 15:05
protectorChristian Graus18-Mar-02 15:05 
GeneralRe: how to buffer it? it looks flicker! Pin
realfly18-Mar-02 15:48
realfly18-Mar-02 15:48 
GeneralRe: how to buffer it? it looks flicker! Pin
Christian Graus18-Mar-02 22:43
protectorChristian Graus18-Mar-02 22:43 
QuestionCan I get the posting data of IE browser before the browser send the data to server? using VC! Pin
wabc17-Mar-02 18:52
wabc17-Mar-02 18:52 
QuestionCan I control the IE browser by using a COM? Pin
wabc17-Mar-02 18:50
wabc17-Mar-02 18:50 
AnswerRe: Can I control the IE browser by using a COM? Pin
C-J Berg17-Mar-02 23:42
C-J Berg17-Mar-02 23:42 
GeneralCreating a setup wizard Pin
Dor17-Mar-02 16:59
Dor17-Mar-02 16:59 
GeneralRe: Creating a setup wizard Pin
hkprs17-Mar-02 17:20
hkprs17-Mar-02 17:20 
GeneralRe: Creating a setup wizard Pin
Nish Nishant17-Mar-02 22:12
sitebuilderNish Nishant17-Mar-02 22:12 
QuestionHow I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
17-Mar-02 16:36
suss17-Mar-02 16:36 
AnswerRe: How I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
Nish Nishant17-Mar-02 16:59
sitebuilderNish Nishant17-Mar-02 16:59 
GeneralRe: How I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
17-Mar-02 19:03
suss17-Mar-02 19:03 
Generalwhere to get the windows xp icon (the icon for App ,Toolbar...) Pin
benben17-Mar-02 16:08
benben17-Mar-02 16:08 
GeneralRe: where to get the windows xp icon (the icon for App ,Toolbar...) Pin
Nish Nishant17-Mar-02 16:30
sitebuilderNish Nishant17-Mar-02 16:30 
GeneralRe: where to get the windows xp icon (the icon for App ,Toolbar...) Pin
lszyn27-Mar-02 23:52
lszyn27-Mar-02 23:52 
GeneralWTL menu driving me nuts... Pin
AlphaDog17-Mar-02 14:57
AlphaDog17-Mar-02 14:57 
GeneralRe: WTL menu driving me nuts... Pin
Todd Smith17-Mar-02 16:20
Todd Smith17-Mar-02 16:20 

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.