Click here to Skip to main content
15,913,904 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: add file to project problem. Pin
Nish Nishant31-Oct-01 13:35
sitebuilderNish Nishant31-Oct-01 13:35 
GeneralRe: add file to project problem. Pin
Michael Martin31-Oct-01 13:55
professionalMichael Martin31-Oct-01 13:55 
GeneralRe: add file to project problem. Pin
solex1-Nov-01 4:38
solex1-Nov-01 4:38 
QuestionHow to shrink a bitmap? Pin
clintsinger31-Oct-01 11:57
clintsinger31-Oct-01 11:57 
AnswerRe: How to shrink a bitmap? Pin
Deepak Khajuria31-Oct-01 17:30
Deepak Khajuria31-Oct-01 17:30 
GeneralRe: How to shrink a bitmap? Pin
clintsinger1-Nov-01 6:30
clintsinger1-Nov-01 6:30 
GeneralRe: How to shrink a bitmap? Pin
Deepak Khajuria1-Nov-01 20:22
Deepak Khajuria1-Nov-01 20:22 
GeneralCreating A Grid On A CView Pin
AJ12331-Oct-01 11:48
AJ12331-Oct-01 11:48 
Hi,

I am trying to draw a grid onto a CView.

The grid doesn't fit into the far right and lower bottom regions correctly. My suspicion is its some strange effect with rounding. It creates a strange effect when you look at the result after resizing the view.

Anyway it's only a small fragment of code, and i would be very grateful if someone would give it a whirl and give their diagnosis.



void CTestView::OnPaint()
{

CPaintDC dc(this); // device context for painting

CRect ScreenDimensions;
GetClientRect(ScreenDimensions);

POINT line[2]; //Array Of Points, Start And End Of Line

//Draw The Columns
for (int col=0; col <=50; col++)
{
line[0].x = ScreenDimensions.Width() / m_cols * col;
line[0].y = 0;

line[1].x = ScreenDimensions.Width() / m_cols * col;
line[1].y = ScreenDimensions.Height();


dc.Polyline(line,2);
}

//Draw The Rows
for (int row=0; row <=50; row++)
{
line[0].x = 0;
line[0].y = ScreenDimensions.Height() / 50 * row;

line[1].x = ScreenDimensions.Width() ;
line[1].y = ScreenDimensions.Height() / 50 * row;


dc.Polyline(line,2);
}
}



Cheers
Richard Jackson
GeneralRe: Creating A Grid On A CView Pin
Christian Graus31-Oct-01 19:08
protectorChristian Graus31-Oct-01 19:08 
GeneralSplitter windows w/o Doc/View Pin
bumby31-Oct-01 11:39
bumby31-Oct-01 11:39 
GeneralRe: Splitter windows w/o Doc/View Pin
Nish Nishant31-Oct-01 13:33
sitebuilderNish Nishant31-Oct-01 13:33 
GeneralRe: Splitter windows w/o Doc/View Pin
bumby1-Nov-01 4:12
bumby1-Nov-01 4:12 
GeneralC++ Language Problem! Pin
Joel Holdsworth31-Oct-01 10:57
Joel Holdsworth31-Oct-01 10:57 
GeneralRe: C++ Language Problem! Pin
Alvaro Mendez31-Oct-01 11:59
Alvaro Mendez31-Oct-01 11:59 
GeneralRe: C++ Language Problem! Pin
Todd Smith31-Oct-01 17:03
Todd Smith31-Oct-01 17:03 
QuestionHow can you see who called OnToolTipNeedText()? Pin
Craig Miller31-Oct-01 10:24
Craig Miller31-Oct-01 10:24 
GeneralLinking Input to an email output Pin
B-Rock31-Oct-01 9:46
B-Rock31-Oct-01 9:46 
GeneralRe: Linking Input to an email output Pin
Alex Griffing31-Oct-01 11:53
Alex Griffing31-Oct-01 11:53 
GeneralRe: Linking Input to an email output Pin
Nish Nishant31-Oct-01 13:25
sitebuilderNish Nishant31-Oct-01 13:25 
GeneralDownload/upload progress control Pin
Ashman31-Oct-01 9:19
Ashman31-Oct-01 9:19 
GeneralRe: Download/upload progress control Pin
Nish Nishant31-Oct-01 13:22
sitebuilderNish Nishant31-Oct-01 13:22 
GeneralRe: Download/upload progress control Pin
Nish Nishant31-Oct-01 13:23
sitebuilderNish Nishant31-Oct-01 13:23 
QuestionHow do I right align text in a pane? Pin
Andrew Stampor31-Oct-01 9:18
Andrew Stampor31-Oct-01 9:18 
Generalcommon open dialog size problem Pin
31-Oct-01 9:15
suss31-Oct-01 9:15 
QuestionListview and combobox questions? Margin in a combobox? Pin
mhowes31-Oct-01 8:13
mhowes31-Oct-01 8:13 

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.