Click here to Skip to main content
15,896,118 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Diff between array and list. Pin
Luc Pattyn7-Aug-07 1:39
sitebuilderLuc Pattyn7-Aug-07 1:39 
GeneralRe: Diff between array and list. Pin
Nandu_77b9-Aug-07 4:51
Nandu_77b9-Aug-07 4:51 
Questionminimizing dialog to system tray Pin
dona jain6-Aug-07 18:50
dona jain6-Aug-07 18:50 
AnswerRe: minimizing dialog to system tray Pin
Mark Salsbery6-Aug-07 20:12
Mark Salsbery6-Aug-07 20:12 
GeneralRe: minimizing dialog to system tray Pin
iddqd5157-Aug-07 3:27
iddqd5157-Aug-07 3:27 
QuestionRepainting Display Seems Slow Pin
BuckBrown6-Aug-07 11:03
BuckBrown6-Aug-07 11:03 
AnswerRe: Repainting Display Seems Slow Pin
Luc Pattyn6-Aug-07 11:10
sitebuilderLuc Pattyn6-Aug-07 11:10 
GeneralRe: Repainting Display Seems Slow Pin
BuckBrown6-Aug-07 11:52
BuckBrown6-Aug-07 11:52 
It is a 200 x 200 array of structs. It is very fast in C++ MFC. No, I'm not creating a lot of objects while painting. Since the document does not repaint when the dialog box goes away I must be doing this outside the Paint handler. When I start my application I have the initial Form1.h file that I use to open a file that contains information to display. This stripped down code that creates a graphics object is shown below... Should I be doing this another way? I really don't understand "outside the Paint handler". How do I do this "inside the Paint handler"?

CWafer^ Wafer;
Graphics^ graphics;
BinDialog^ binDialog;
System::Drawing::Font^ drawFont;

private: System::Void openToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
BinData = gcnew array<bool>(33);
BinData->Clear(BinData, 0, BinData->Length);
graphics = this->CreateGraphics();
Wafer = gcnew CWafer();
binDialog = gcnew BinDialog();
drawFont = gcnew System::Drawing::Font("Courier New", 6);
DisplayWaferMap();
viewToolStripMenuItem->Enabled::set(true);
zoomToolStripMenuItem->Enabled::set(true);
toolsToolStripMenuItem->Enabled::set(true);
printToolStripMenuItem->Enabled::set(true);
printPreviewToolStripMenuItem->Enabled::set(true);
}

//---------------------------------------------------------------------------

private: System::Void DisplayWaferMap()
{
graphics->Clear(Color::White);
DisplayMapPerimeter();
DisplayMapText();
}

//---------------------------------------------------------------------------

private: System::Void DisplayMapPerimeter()
{
Pen^ blackPen = gcnew Pen(Color::Black);
Point point1;
Point point2;
double height;
double radius;
double radians;
float start_angle;
float sweep_angle;
float angle_of_incidence = 20; // In degrees

sweep_angle = 360 - (2 * angle_of_incidence);
radians = angle_of_incidence / 57.29578;
height = this->Size.Height - 100;
radius = height / 2;

Rectangle rect = Rectangle(50, 50, (int)height, (int)height);

switch (Wafer->FlatOrientation)
{
case FLAT_RIGHT:
start_angle = angle_of_incidence;
point1.X = (int)(radius + (Math::Cos(radians) * radius) + 50);
point2.X = (int)(radius + (Math::Cos(radians) * radius) + 50);
point1.Y = (int)(radius + (Math::Sin(radians) * radius) + 50);
point2.Y = (int)(radius - (Math::Sin(radians) * radius) + 50);
break;
case FLAT_DOWN:
start_angle = angle_of_incidence + 90;
point1.X = (int)(radius - (Math::Sin(radians) * radius) + 50);
point2.X = (int)(radius + (Math::Sin(radians) * radius) + 50);
point1.Y = (int)(radius + (Math::Cos(radians) * radius) + 50);
point2.Y = (int)(radius + (Math::Cos(radians) * radius) + 50);
break;
case FLAT_LEFT:
start_angle = angle_of_incidence + 180;
point1.X = (int)(radius - (Math::Cos(radians) * radius) + 50);
point2.X = (int)(radius - (Math::Cos(radians) * radius) + 50);
point1.Y = (int)(radius + (Math::Sin(radians) * radius) + 50);
point2.Y = (int)(radius - (Math::Sin(radians) * radius) + 50);
break;
case FLAT_UP:
start_angle = angle_of_incidence + 270;
point1.X = (int)(radius - (Math::Sin(radians) * radius) + 50);
point2.X = (int)(radius + (Math::Sin(radians) * radius) + 50);
point1.Y = (int)(radius - (Math::Cos(radians) * radius) + 50);
point2.Y = (int)(radius - (Math::Cos(radians) * radius) + 50);
break;
default: break;
}
graphics->DrawArc(blackPen, rect, start_angle, sweep_angle);
graphics->DrawLine(blackPen, point1.X, point1.Y, point2.X, point2.Y);
}

//---------------------------------------------------------------------------

private: System::Void DisplayMapText()
{
System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Ariel", 14);
SolidBrush^ blackBrush = gcnew SolidBrush(Color::Black);

float x_coord;
float y_coord;
float height;
float width;

height = (float)this->Size.Height;
width = (float)this->Size.Height;

x_coord = width - 50;
y_coord = height - 250;

graphics->DrawString( "Part Number", drawFont, blackBrush, x_coord, y_coord);
graphics->DrawString( ":", drawFont, blackBrush, x_coord + 150, y_coord);
graphics->DrawString( Wafer->DeviceName, drawFont, blackBrush, x_coord + 180, y_coord);

y_coord = height - 225;
graphics->DrawString( "Lot Number", drawFont, blackBrush, x_coord, y_coord);
graphics->DrawString( ":", drawFont, blackBrush, x_coord + 150, y_coord);
graphics->DrawString( Wafer->LotNumber, drawFont, blackBrush, x_coord + 180, y_coord);

y_coord = height - 200;
graphics->DrawString( "Wafer Number", drawFont, blackBrush, x_coord, y_coord);
graphics->DrawString( ":", drawFont, blackBrush, x_coord + 150, y_coord);
graphics->DrawString( Wafer->WaferNumber, drawFont, blackBrush, x_coord + 180, y_coord);

y_coord = height - 175;
graphics->DrawString( "Yield", drawFont, blackBrush, x_coord, y_coord);
graphics->DrawString( ":", drawFont, blackBrush, x_coord + 150, y_coord);
graphics->DrawString( "100%", drawFont, blackBrush, x_coord + 180, y_coord);
}


Buck
GeneralRe: Repainting Display Seems Slow Pin
Luc Pattyn6-Aug-07 12:14
sitebuilderLuc Pattyn6-Aug-07 12:14 
GeneralRe: Repainting Display Seems Slow Pin
BuckBrown7-Aug-07 6:24
BuckBrown7-Aug-07 6:24 
GeneralRe: Repainting Display Seems Slow Pin
Luc Pattyn7-Aug-07 6:51
sitebuilderLuc Pattyn7-Aug-07 6:51 
GeneralRe: Repainting Display Seems Slow Pin
BuckBrown7-Aug-07 7:55
BuckBrown7-Aug-07 7:55 
GeneralRe: Repainting Display Seems Slow Pin
Luc Pattyn7-Aug-07 13:36
sitebuilderLuc Pattyn7-Aug-07 13:36 
Questionhow to convert a String to datetime and do subtraction of time ??? Pin
aefmaaradji6-Aug-07 1:01
aefmaaradji6-Aug-07 1:01 
AnswerRe: how to convert a String to datetime and do subtraction of time ??? Pin
Luc Pattyn6-Aug-07 1:12
sitebuilderLuc Pattyn6-Aug-07 1:12 
Questiondouble(*)[2] ? Pin
dalgados5-Aug-07 21:18
dalgados5-Aug-07 21:18 
AnswerRe: double(*)[2] ? Pin
prasad_som5-Aug-07 22:22
prasad_som5-Aug-07 22:22 
Questionhow to declare a matrix in visual c++.net 2005 c++ cli ? Pin
aefmaaradji5-Aug-07 0:28
aefmaaradji5-Aug-07 0:28 
AnswerRe: how to declare a matrix in visual c++.net 2005 c++ cli ? Pin
mid=57415-Aug-07 5:17
mid=57415-Aug-07 5:17 
GeneralRe: how to declare a matrix in visual c++.net 2005 c++ cli ? Pin
aefmaaradji5-Aug-07 12:09
aefmaaradji5-Aug-07 12:09 
GeneralRe: how to declare a matrix in visual c++.net 2005 c++ cli ? Pin
mid=57415-Aug-07 12:16
mid=57415-Aug-07 12:16 
GeneralRe: how to declare a matrix in visual c++.net 2005 c++ cli ? Pin
George L. Jackson5-Aug-07 13:24
George L. Jackson5-Aug-07 13:24 
GeneralRe: how to declare a matrix in visual c++.net 2005 c++ cli ? Pin
aefmaaradji6-Aug-07 0:52
aefmaaradji6-Aug-07 0:52 
QuestionHow to wrap native array? Pin
mid=57414-Aug-07 9:06
mid=57414-Aug-07 9:06 
AnswerRe: How to wrap native array? Pin
Luc Pattyn4-Aug-07 9:24
sitebuilderLuc Pattyn4-Aug-07 9:24 

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.