Now... I'm really curious about what that word was... :DQuote:
Originally posted by Marc G
LOL ... this board replaces some words with *'s. The word i typed wasn't even a bad word!
Printable View
Now... I'm really curious about what that word was... :DQuote:
Originally posted by Marc G
LOL ... this board replaces some words with *'s. The word i typed wasn't even a bad word!
i did...i saw him using MM_LOENGLISH almost everywhere in drawing so i though might just as welll...:blushQuote:
Originally posted by gstercken
(haven't you read the GDI chapters in Prosise's book ;) ?)
WOW!!!:eek: really works great.....Quote:
Originally posted by Marc G
This version is extremely fast while editing the bitmap (bitmaps upto 6400x4800 and possibly even higher, do mind that the scrollbars overflow with this kind of images!), but there's still a bit of flicker when scrolling the big editing view.
Note 1: The code is a mess, but i don't have time to clean it. It could be even the case there are some redundant lines of code, but you get the idea.
can u pl slet me in your secret..WOW, what did you do to make this happen??:eek:
when i draw a str8 line some squares in between lines are missed(not colored)...is that a prob cause of the speed?:confused: :(
tksa lot...
really really appreciate your effort and kind help.. :)
LOENGLISH is good if you use some real metric like gstercken said, but you are working with pixels so you want MM_TEXT to draw at pixel precision and it's much easier to work with because in your case pixels is the natural measurement.
A memory bitmap instead of a separate pixel array.Quote:
Originally posted by Joseph_R_Thomas
WOW!!!:eek: really works great.....
can u pl slet me in your secret..WOW, what did you do to make this happen??:eek:
This way, you only have to do a simple blit to draw the little preview.
To make the large view fast, when you click the mouse, only invalidate the rectangle where the mouse was clicked in, instead of redrawing the entire view ;)
Yes that's a problem of speed, but not a problem of the drawing code, but rather the mouse driver or something.The way this is mostly solved is the following:Quote:
when i draw a str8 line some squares in between lines are missed(not colored)...is that a prob cause of the speed?:confused: :(
- You click your left button somewhere on a square and remember this position.
- Now, when the mouse generates a mousemove event, the mouse could already have skipped a few rectangles, so you calculate the square where the mouse currently is and just interpolate between this square and the square you stored in the previous step.
Now save the square under the cursor.
- Repeat previous step.
:)Quote:
tksa lot...
really really appreciate your effort and kind help.. :)
It has 4 letters, starts with D and ends with N :DQuote:
Originally posted by gstercken
Now... I'm really curious about what that word was... :D
:)Quote:
Originally posted by Marc G
:)
tks a lot..
really really appreciate you guys' help....
tks a lot...
i have another question...i want to change the background that i am drawing at to black...inside the grid and outside(CEditorViuew) and inside and outside the square(CPeekVIew)..
i understand that i am supposed to chagne my OnEraseBackground to this
but currently my OnErase Background looks like this..Code:CRect rect;
pDC->GetClipBox(rect);
CBrush brush(RGB(0, 0, 0));
CBrush* pBrush = pDC->SelectObject(&brush);
pDC->Rectangle(rect);
pDC->SelectObject(pBrush);
return TRUE;
in the previous post you told me that the erasebkground is like above cause it contributes in scrolling..Code:BOOL CPeekView::OnEraseBkgnd(CDC* pDC)
{
//return TRUE;
return CScrollView::OnEraseBkgnd(pDC);
}
so if i dont change the above code for OnEdraseBkGround, then how can i do such that my both view are all black??inside and outside the grid as well as the square..
i have already changed the grid lines to grey..now i need to make the bkground black..
can u pls tell me how..??
tks a lot :)
That code should work fine. What is the problem?Quote:
Originally posted by Joseph_R_Thomas
i have another question...i want to change the background that i am drawing at to black...inside the grid and outside(CEditorViuew) and inside and outside the square(CPeekVIew)..
i understand that i am supposed to chagne my OnEraseBackground to this
Code:CRect rect;
pDC->GetClipBox(rect);
CBrush brush(RGB(0, 0, 0));
CBrush* pBrush = pDC->SelectObject(&brush);
pDC->Rectangle(rect);
pDC->SelectObject(pBrush);
return TRUE;
o i c...
so u mean, i can change
to thisCode:BOOL CPeekView::OnEraseBkgnd(CDC* pDC)
{
//return TRUE;
return CScrollView::OnEraseBkgnd(pDC);
}
right???Code:BOOL CPeekView::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
pDC->GetClipBox(rect);
CBrush brush(RGB(0, 0, 0));
CBrush* pBrush = pDC->SelectObject(&brush);
pDC->Rectangle(rect);
pDC->SelectObject(pBrush);
return TRUE;
}
ok...tks a lot:)...i can now move to save th ePreview as a Bitmap right??:)
the prob is that only the outer areas of the grid and the PeekView are black...:(Quote:
Originally posted by Marc G
That code should work fine. What is the problem?
inside all is White...:(
Well, that's because you set the colors of all initial rectangles to white.
See your code in CEditorDoc::OnNewDocument()
change
toCode:m_dc.FillSolidRect(0, 0, m_clrGrid.GetSizeX(), m_clrGrid.GetSizeY(), RGB(255,255,255));
NOTE: I think you can remove all the m_clrGrid stuff because it's not used anymore IIRC. But when you remove it, do not forget to change the implementation of CEditorDoc::GetGridX() and CEditorDoc::GetGridY()!Code:m_dc.FillSolidRect(0, 0, m_clrGrid.GetSizeX(), m_clrGrid.GetSizeY(), RGB(0,0,0));
:wave
tkls a lot.... however can i trouble u for one last thing pls???
in the attached project.... is there any way i can make the flashing of the PeekView go away while maintaining the good speed of drawing???:( :confused: :(
tks a lot..
In your void CPeekView::OnDraw(CDC* pDC) change the following line:
toCode:pDC->Rectangle(&rectImage);
:wave:Code:CBrush hollowBrush;
hollowBrush.CreateStockObject(HOLLOW_BRUSH);
CBrush* pOldBrush = pDC->SelectObject(&hollowBrush);
pDC->Rectangle(&rectImage);
pDC->SelectObject(pOldBrush);
how can i put the msg to warn the user NOT to exit cause the file is not save(i dun want to use serialize)
so that if the user presses cancel he can go back to the app??
tks...:)
Add a WM_CLOSE handler and ask the user if he wants to save the file. If he/she presses cancel, don't call "CDialog::OnClose();" otherwise do call it and the app will close.
Actually you'll want to override the OnClose in the MainFrame....right?
TDM