Click here to Skip to main content
14,484,849 members

Managed C++/CLI

 
GeneralRe: How to use WndProc or WindowsProc function Pin
mmhu11-Aug-06 4:24
Membermmhu11-Aug-06 4:24 
GeneralRe: How to use WndProc or WindowsProc function Pin
Milton Karimbekallil13-Aug-06 20:47
MemberMilton Karimbekallil13-Aug-06 20:47 
GeneralRe: How to use WndProc or WindowsProc function Pin
mmhu14-Aug-06 2:17
Membermmhu14-Aug-06 2:17 
GeneralRe: How to use WndProc or WindowsProc function Pin
Milton Karimbekallil15-Aug-06 18:00
MemberMilton Karimbekallil15-Aug-06 18:00 
GeneralRe: How to use WndProc or WindowsProc function Pin
mmhu17-Aug-06 11:05
Membermmhu17-Aug-06 11:05 
Question.NET slow graphics Pin
9ine9-Aug-06 1:03
Member9ine9-Aug-06 1:03 
AnswerRe: .NET slow graphics Pin
led mike9-Aug-06 6:00
Memberled mike9-Aug-06 6:00 
GeneralRe: .NET slow graphics [modified] Pin
9ine10-Aug-06 1:21
Member9ine10-Aug-06 1:21 
This is the whole code to render some float array to a form


/////////data////////////////////////////////////////////////////////
Bitmap *canvas = new Bitmap(1280,1024);
Graphics *memg = Graphics::FromImage(canvas);
memg->SmoothingMode = SmoothingMode::HighSpeed;
/////////////////////////////////////////////////////////////////////


private: System::Void p2Dform_Paint(System::Object *sender, System::Windows::Forms::PaintEventArgs *e)
{
paint();
}

private: System::Void p2Dform_Resize(System::Object *sender, System::EventArgs *e)
{
resize();
}




private: void p2Dform::paint(void)
{
Graphics *g = CreateGraphics();
System::Drawing::Rectangle rect(0,0,ClientSize.Width,ClientSize.Height);
//draw image data
g->DrawImage(canvas,0,0,rect,GraphicsUnit::Pixel);

g->Dispose();
}

private: void p2Dform::resize(void)
{
memg->FillRectangle(wbrush,0,0,ClientSize.Width,ClientSize.Height);

//draw file data to memg
draw(ClientSize.Width,ClientSize.Height,color,m_data,len,miny,maxy);
paint();
}




private: void p2Dform::draw(int width,int height,int color, float *data,int len,float minY,float maxY)
{
bpen = new Pen(Color::FromArgb(color));

float stepx,stepy,X1,Y1,X2,Y2;
stepx = float(width-1 - addX*2)/float(len-1);
stepy = float(height-1 - addY*2)/Math::Abs(float(maxY-minY));

for(int i=1; i<len; i++)
{
X1 = stepx*float(i-1);
X2 = stepx*float(i);
Y1 = data[i-1];
if(minY < 0) Y1 += (-1.0f)*minY;
if(minY > 0) Y1 -= minY;
Y1 = float(height-1) - Y1*stepy;
Y2 = data[i];
if(minY < 0) Y2 += (-1.0f)*minY;
if(minY > 0) Y2 -= minY;
Y2 = float(height-1) - Y2*stepy;

memg->DrawLine(bpen,X1+addX,Y1-addY,X2+addX,Y2-addY);
}

bpen->Dispose();
}

9ine
GeneralRe: .NET slow graphics Pin
led mike10-Aug-06 5:03
Memberled mike10-Aug-06 5:03 
GeneralRe: .NET slow graphics Pin
9ine10-Aug-06 6:15
Member9ine10-Aug-06 6:15 
GeneralRe: .NET slow graphics Pin
led mike10-Aug-06 6:30
Memberled mike10-Aug-06 6:30 
GeneralRe: .NET slow graphics Pin
9ine10-Aug-06 23:18
Member9ine10-Aug-06 23:18 
GeneralRe: .NET slow graphics Pin
led mike15-Aug-06 7:40
Memberled mike15-Aug-06 7:40 
AnswerRe: .NET slow graphics Pin
Joe Woodbury14-Aug-06 17:22
professionalJoe Woodbury14-Aug-06 17:22 
GeneralRe: .NET slow graphics Pin
9ine14-Aug-06 23:51
Member9ine14-Aug-06 23:51 
GeneralRe: .NET slow graphics Pin
9ine14-Aug-06 23:52
Member9ine14-Aug-06 23:52 
GeneralRe: .NET slow graphics Pin
Christian Graus15-Aug-06 0:21
mveChristian Graus15-Aug-06 0:21 
GeneralRe: .NET slow graphics Pin
9ine16-Aug-06 0:12
Member9ine16-Aug-06 0:12 
GeneralRe: .NET slow graphics Pin
Christian Graus16-Aug-06 2:12
mveChristian Graus16-Aug-06 2:12 
GeneralRe: .NET slow graphics Pin
9ine16-Aug-06 3:51
Member9ine16-Aug-06 3:51 
GeneralRe: .NET slow graphics Pin
Christian Graus16-Aug-06 10:47
mveChristian Graus16-Aug-06 10:47 
GeneralRe: .NET slow graphics Pin
Joe Woodbury15-Aug-06 8:16
professionalJoe Woodbury15-Aug-06 8:16 
GeneralRe: .NET slow graphics Pin
9ine16-Aug-06 0:16
Member9ine16-Aug-06 0:16 
GeneralRe: .NET slow graphics Pin
Joe Woodbury16-Aug-06 8:23
professionalJoe Woodbury16-Aug-06 8:23 
QuestionHow to Use String::Format Method Pin
Nagaraju_Focus7-Aug-06 22:59
MemberNagaraju_Focus7-Aug-06 22:59 

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.