Click here to Skip to main content
15,895,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVS2005 Team Pin
Alex_Y14-Jul-06 8:12
Alex_Y14-Jul-06 8:12 
AnswerRe: VS2005 Team Pin
Jun Du14-Jul-06 8:22
Jun Du14-Jul-06 8:22 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 8:43
Alex_Y14-Jul-06 8:43 
GeneralRe: VS2005 Team Pin
Jun Du14-Jul-06 9:23
Jun Du14-Jul-06 9:23 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 9:36
Alex_Y14-Jul-06 9:36 
GeneralRe: VS2005 Team Pin
Jun Du14-Jul-06 9:49
Jun Du14-Jul-06 9:49 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 11:25
Alex_Y14-Jul-06 11:25 
QuestionWhat's the best way to do this? Pin
Alex Cutovoi14-Jul-06 8:07
Alex Cutovoi14-Jul-06 8:07 
Hi fellows

I'm creating a app that reads data from a database and creates a graphic to show the results. I have a problem with this. I'll have a lot of registers, about 50000. I've think to sum the quantities of the registers and adjust the x-axis and the y-axis according this values. But for this I need to have a big screen resolution. How can I do this to show for the user adjusting in the window program? If anyone knows please tell me. I just want to get an idea, only this, not the entire solution.
I put a piece of code if anyone gets interesting
<br />
RECT tempRect, myRect;<br />
         GetClientRect(hwnd, &tempRect);<br />
         HBRUSH rectBrush;<br />
         char cTemp3[10];<br />
         int iSize = sizeof(tempPoint)/sizeof(POINT);<br />
         int iXMarquees, iYMarquees, iXSpace, iYSpace = 0;<br />
         POINT points[iSize], tmpPoint;<br />
         LOGPEN LogPen;<br />
         HPEN GraphicPen, LinesPen;<br />
         tmpPoint.x = 2;<br />
         LogPen.lopnStyle = PS_SOLID;<br />
         LogPen.lopnWidth = tmpPoint;<br />
         LogPen.lopnColor = 0x00000000;<br />
         GraphicPen = CreatePenIndirect(&LogPen);<br />
         for(int i = 0 ; i < iSize ; i++)<br />
         {<br />
            points[i].x = (ixClient * tempPoint[i].x)/400;<br />
            points[i].y = (int)(((iyClient * tempPoint[i].y)/450)-iLine)+iYConst;<br />
         }<br />
         hdc = BeginPaint(hwnd, &ps);<br />
         SelectObject(hdc, GraphicPen);<br />
         SetBkMode(hdc, TRANSPARENT);<br />
         TextOut(hdc, ixClient/2, iLine, TEXT("Olá"), sizeof("Olá"));<br />
         Polyline(hdc, points, (sizeof(points)/sizeof(POINT)));<br />
         //Eixo x-y<br />
         iXGraphLine = tempRect.right-80;<br />
         iYGraphLine = (tempRect.bottom-150)-iLine;<br />
         //Pen do eixo x-y<br />
         tmpPoint.x = 2;<br />
         LogPen.lopnStyle = PS_SOLID;<br />
         LogPen.lopnWidth = tmpPoint;<br />
         LogPen.lopnColor = 0x00FF0000;<br />
         LinesPen = CreatePenIndirect(&LogPen);<br />
         SelectObject(hdc, LinesPen);<br />
         iXSpace = iXGraphLine/(iSize*2);<br />
         iYSpace = iYGraphLine/(iSize*2);<br />
         for(int i = 0, iXpos = iXSpace, iYpos = iYSpace, iXFont = 10 ; i < iSize*2 ; i++)<br />
         {<br />
            SelectObject(hdc, LinesPen);<br />
            char cTemp10[5];<br />
            //Desenha as linhas divisórias do eixo X<br />
            MoveToEx(hdc, (iXpos-15), iYGraphLine-10-iLine, NULL);<br />
            LineTo(hdc, (iXpos-15), iYGraphLine+10-iLine);<br />
            itoa(iXpos, cTemp10, 10);<br />
            cTemp10[5]='\0';<br />
            /* Calcula a posição do texto de acordo com o tamanho entre *<br />
             * as divisões da linha horizontal e do tamanho do texto    */<br />
            SetTextAlign(hdc, TA_CENTER);<br />
            TextOut(hdc, iXpos-(((strlen(cTemp10)*iXCaps)+iXChar)/strlen(cTemp10))-2, iYGraphLine+10-iLine, cTemp10, strlen(cTemp10));<br />
            iXFont+=iXSpace/2;<br />
            iXpos+=iXSpace;<br />
            //Desenha as linhas divisórias do eixo Y<br />
            MoveToEx(hdc, 5, (iYpos-15)-iLine, NULL);<br />
            LineTo(hdc, 25, (iYpos-15)-iLine);<br />
            itoa(iYpos, cTemp10, 10);<br />
            TextOut(hdc, 40, (((iYSpace*((iSize*2)-i))-4)-(((strlen(cTemp10)*iXCaps)+iYChar)/strlen(cTemp10))-2)-iLine, cTemp10, strlen(cTemp10));<br />
            iYpos+=iYSpace;<br />
            SelectObject(hdc, GraphicPen);<br />
            SelectObject(hdc, CreateSolidBrush(0x00000000));<br />
            if(i < 5)Pie(hdc, points[i].x-4, points[i].y-4, points[i].x+4, points[i].y+4, 10,10,0,0);<br />
         }<br />
         SelectObject(hdc, LinesPen);<br />
         //Linha Vertical<br />
         MoveToEx(hdc, 15, -iLine, NULL);<br />
         LineTo(hdc, 15, iYGraphLine-iLine);<br />
         //Linha Horizontal<br />
         MoveToEx(hdc, 15, iYGraphLine-iLine, NULL);<br />
         LineTo(hdc, iXGraphLine, iYGraphLine-iLine);<br />
         rectBrush = CreateSolidBrush(0x00FFFFFF);<br />
         myRect.top    = (tempRect.bottom-100-iLine*2);<br />
         myRect.bottom = (tempRect.bottom-10-iLine*2);<br />
         myRect.left   = 50;<br />
         myRect.right  = 200;<br />
         FillRect(hdc, &myRect, rectBrush);<br />
         SelectObject(hdc, GraphicPen);<br />
         MoveToEx(hdc, 60, ((myRect.bottom+myRect.top)/2)-30, NULL);<br />
         LineTo(hdc,  130, ((myRect.bottom+myRect.top)/2)-30);<br />
         TextOut(hdc, 160, ((myRect.bottom+myRect.top)/2-30-(((strlen("Lalala")*iXCaps)+iYChar)/strlen("Lalala"))+2), "Lalala", strlen("Lalala"));<br />
         EndPaint(hwnd, &ps);<br />
         DeleteObject(GraphicPen);<br />
         DeleteObject(LinesPen);<br />
         DeleteObject(rectBrush);<br />
         ReleaseDC(hwnd, hdc);<br />
<code>

QuestionRe: What's the best way to do this? Pin
Jun Du14-Jul-06 8:27
Jun Du14-Jul-06 8:27 
AnswerRe: What's the best way to do this? Pin
Alex Cutovoi14-Jul-06 8:55
Alex Cutovoi14-Jul-06 8:55 
GeneralRe: What's the best way to do this? Pin
Jun Du14-Jul-06 9:47
Jun Du14-Jul-06 9:47 
QuestionDifference between debug and execution on open file Pin
hli114-Jul-06 7:52
hli114-Jul-06 7:52 
AnswerRe: Difference between debug and execution on open file Pin
eusto14-Jul-06 8:12
eusto14-Jul-06 8:12 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 8:35
hli114-Jul-06 8:35 
GeneralRe: Difference between debug and execution on open file Pin
PJ Arends14-Jul-06 8:42
professionalPJ Arends14-Jul-06 8:42 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 9:02
hli114-Jul-06 9:02 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 9:33
hli114-Jul-06 9:33 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 10:03
hli114-Jul-06 10:03 
QuestionPassing data between tabs in a tab control [modified] Pin
cppcook14-Jul-06 7:36
cppcook14-Jul-06 7:36 
AnswerRe: Passing data between tabs in a tab control Pin
eusto14-Jul-06 8:09
eusto14-Jul-06 8:09 
GeneralRe: Passing data between tabs in a tab control Pin
cppcook14-Jul-06 8:23
cppcook14-Jul-06 8:23 
GeneralRe: Passing data between tabs in a tab control Pin
eusto14-Jul-06 8:48
eusto14-Jul-06 8:48 
AnswerRe: Passing data between tabs in a tab control Pin
Hamid_RT14-Jul-06 8:14
Hamid_RT14-Jul-06 8:14 
GeneralRe: Passing data between tabs in a tab control Pin
cppcook14-Jul-06 8:26
cppcook14-Jul-06 8:26 
GeneralRe: Passing data between tabs in a tab control Pin
Hamid_RT14-Jul-06 19:00
Hamid_RT14-Jul-06 19:00 

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.