Home > Software engineering >  Drawing problems within a modal dialog box
Drawing problems within a modal dialog box

Time:11-08

Has built a dialog box, in the drawings, the use of modal dialog box that's ok, there is a timer to achieve dynamic curve, using the modal dialog box sometimes point out easy to collapse, now want to change to a modal dialog box, why can appear not defined type

 void Ccurve: : addtaxis (int data, int * path)//data for drawing data frames 
{
//memory mapping
PWnd1=GetDlgItem (IDC_STATIC_view);//control ID
PDC1=pWnd1 - & gt; GetDC ();
PWnd1 - & gt; GetWindowRect (& amp; Rect1);//rc to control the size of the
W=rect1. Width () - 50;
H=rect1. Height ();
M=H/40;
Bmp1=new Bitmap (W + 50-2 H - 1);//memory bitmap H

Pen Pen Color (0, 0, 0), (3);//frame bold lines
Pen spen (Color (0, 0, 0), 1);//border lines
Gdiplus: : the Font myFont (L "Arial", 8);
255,0,0,0 SolidBrush brushB (Color ());
Graphics Graphics (bmp1);
HatchBrush newBrush (HatchStyleCross, Color (2555, 255, 255, 255), Color (255, 255, 255255));//white
Graphics. FillRectangle (& amp; NewBrush, 0, 0, rect1. Width (), H);//to draw area filling white back
for(int i=0; i<25. I++)
{
Graphics. DrawLine (& amp; Spen, W * I/24 40, 0, + W * 24 + 40, I/H);//vertical thin lines
If (I % 4==0)
Graphics. DrawLine (& amp; Pen, W * I/24 40, 0, + W * 24 + 40, I/H);//longitudinal bold lines
}
for(int j=1; j<=400; J++)
{
If (0==10) (deepth - data + j) %//the position of the integer m
{
Graphics. DrawLine (& amp; Spen, 40, H * j/400, W + 40, H * j/400);//horizontal lines
If ((deepth - data + j) % 100==0)//10 m the location of the
{
Graphics. DrawLine (& amp; Pen, 40, H * j/400, W + 40, H * j/400);//horizontal thick line
WCHAR buf [160].
WsprintfW (buf, L "% d", (deepth - data + j)/10);//note is the figure, the above figures, the following number is small, + 40 is a screen is empty because of the beginning, attach useless
Graphics. DrawString (buf, 1, & amp; MyFont PointF (0, H * j/400-10), & amp; BrushB);//every 10 meters, add the longitudinal coordinate data
}
}
}
Addcurve (graphics, pen0, 0, path, data);
Addcurve (graphics, pen1, 1, path + 1, data);
Addcurve (graphics, pen2, 2, path + 2, data);
Addcurve (graphics, pen3 and 3, the path + 3, data);
Addcurve (graphics, pen4, 4, path + 4, data);
Addcurve (graphics, pen5, 5, path + 5, data);
Addcurve (graphics, pen6, 6, path + 6, data);
Addcurve (graphics, pen7, 7, path + 7, data);
Addcurve (graphics, pen8, 8, path + 8, data);
Addcurve (graphics, pen9, 9, path + 9, data);
Addcurve (graphics, pen10, 10, path + 10, data);
Addcurve (graphics, pen11, 11, path + 11, data);
Graphics gr (pDC1 - & gt; M_hDC);
Gr. DrawImage (bmp1, 1,1,0,0, W + 50, H 2, UnitPixel);
The ReleaseDC (pDC1);//release DC;
The delete bmp1;
Bmp1=NULL;
}
  • Related