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

Managed C++/CLI

 
GeneralRe: C++/CLI Zooming [modified] Pin
Luc Pattyn29-Aug-07 13:17
sitebuilderLuc Pattyn29-Aug-07 13:17 
GeneralRe: C++/CLI Zooming Pin
Mark Salsbery29-Aug-07 14:18
Mark Salsbery29-Aug-07 14:18 
GeneralRe: C++/CLI Zooming Pin
Luc Pattyn29-Aug-07 15:41
sitebuilderLuc Pattyn29-Aug-07 15:41 
GeneralRe: C++/CLI Zooming Pin
Mark Salsbery29-Aug-07 18:40
Mark Salsbery29-Aug-07 18:40 
GeneralRe: C++/CLI Zooming Pin
Luc Pattyn29-Aug-07 23:31
sitebuilderLuc Pattyn29-Aug-07 23:31 
GeneralRe: C++/CLI Zooming Pin
Mark Salsbery30-Aug-07 4:56
Mark Salsbery30-Aug-07 4:56 
AnswerRe: C++/CLI Zooming Pin
Mark Salsbery28-Aug-07 12:56
Mark Salsbery28-Aug-07 12:56 
QuestionRuberbanding graphics without repainting entire screen Pin
BuckBrown28-Aug-07 10:01
BuckBrown28-Aug-07 10:01 
Hi, I am using Visual Studio 2005 C++/CLI. I am delving into some event driven programming and I can use the mouse to draw a rectangle. The rectangle is drawn as the user moves the mouse with the left button down. I am using the Graphics->DrawRectangle() method. The idea here is to DrawRectangle() over the previous rectangle with a white pen the draw the new rectangle with a black pen. What I am seeing (and it makes complete sense) is that as I move the mouse the drawing of the white rectangle "covers" some of the screen display that was already there. This doesn't seem very elegant. Is there a method that will remove the previous rectangle without disturbing the existing screen display. I don't want to paint the entire screen because my application takes about 1 second to paint the entire screen.

private: System::Void Form_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
if(e->Button == System::Windows::Forms::MouseButtons::Left)
{
int height = zoomRectEndPos->Y - zoomRectStartPos->Y;
int width = zoomRectEndPos->X - zoomRectStartPos->X;

zoomRectEndPos = this->MousePosition;

Graphics^ g = this->CreateGraphics();
Pen^ whitePen = gcnew Pen(Color::White, 0.5);
g->DrawRectangle(whitePen, zoomRectStartPos->X, zoomRectStartPos->Y, nPreviousWidth, nPreviousHeight);
Pen^ blackPen = gcnew Pen(Color::Black, 0.5);
g->DrawRectangle(blackPen, zoomRectStartPos->X, zoomRectStartPos->Y, width, height);
nPreviousWidth = width;
nPreviousHeight = height;
}
}

Thanks,

Buck
AnswerRe: Ruberbanding graphics without repainting entire screen Pin
Luc Pattyn28-Aug-07 12:30
sitebuilderLuc Pattyn28-Aug-07 12:30 
GeneralRe: Ruberbanding graphics without repainting entire screen Pin
BuckBrown28-Aug-07 12:43
BuckBrown28-Aug-07 12:43 
QuestionMethod definitions in header files Pin
Xpnctoc28-Aug-07 9:11
Xpnctoc28-Aug-07 9:11 
AnswerRe: Method definitions in header files Pin
led mike29-Aug-07 5:21
led mike29-Aug-07 5:21 
AnswerRe: Method definitions in header files Pin
George L. Jackson29-Aug-07 7:37
George L. Jackson29-Aug-07 7:37 
GeneralRe: Method definitions in header files Pin
Xpnctoc29-Aug-07 8:29
Xpnctoc29-Aug-07 8:29 
GeneralRe: Method definitions in header files [modified] Pin
George L. Jackson29-Aug-07 12:01
George L. Jackson29-Aug-07 12:01 
GeneralRe: Method definitions in header files Pin
Mark Salsbery29-Aug-07 12:33
Mark Salsbery29-Aug-07 12:33 
GeneralRe: Method definitions in header files [modified] Pin
George L. Jackson29-Aug-07 12:54
George L. Jackson29-Aug-07 12:54 
GeneralRe: Method definitions in header files Pin
Mark Salsbery29-Aug-07 13:08
Mark Salsbery29-Aug-07 13:08 
Questionc++ Pin
ellllllllie28-Aug-07 5:03
ellllllllie28-Aug-07 5:03 
AnswerRe: c++ Pin
Luc Pattyn28-Aug-07 5:31
sitebuilderLuc Pattyn28-Aug-07 5:31 
Questionhow to get the primary key for a new row Pin
Stefan Baens27-Aug-07 22:50
Stefan Baens27-Aug-07 22:50 
AnswerRe: how to get the primary key for a new row Pin
George L. Jackson28-Aug-07 0:00
George L. Jackson28-Aug-07 0:00 
GeneralRe: how to get the primary key for a new row Pin
Stefan Baens28-Aug-07 1:04
Stefan Baens28-Aug-07 1:04 
GeneralRe: how to get the primary key for a new row Pin
George L. Jackson28-Aug-07 4:14
George L. Jackson28-Aug-07 4:14 
GeneralRe: how to get the primary key for a new row Pin
George L. Jackson28-Aug-07 13:36
George L. Jackson28-Aug-07 13:36 

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.