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

Managed C++/CLI

 
AnswerRe: date function Pin
toxcct22-Feb-06 21:59
toxcct22-Feb-06 21:59 
GeneralRe: date function Pin
ptvce23-Feb-06 1:20
ptvce23-Feb-06 1:20 
GeneralRe: date function Pin
toxcct23-Feb-06 1:38
toxcct23-Feb-06 1:38 
QuestionC++ Service Pin
Esmo200022-Feb-06 14:06
Esmo200022-Feb-06 14:06 
AnswerRe: C++ Service Pin
George L. Jackson22-Feb-06 17:22
George L. Jackson22-Feb-06 17:22 
QuestionDraw line on image!!!!!!!!!! Pin
ArianN21-Feb-06 16:42
ArianN21-Feb-06 16:42 
AnswerRe: Draw line on image!!!!!!!!!! Pin
Christian Graus21-Feb-06 17:26
protectorChristian Graus21-Feb-06 17:26 
GeneralRe: Draw line on image!!!!!!!!!! Pin
ArianN23-Feb-06 16:12
ArianN23-Feb-06 16:12 
Here is a simple extract off the code::

private: System::Void viewPictureE_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {

PaintProccesImage(e);

void frmPictureEdit::PaintProccesImage(PaintEventArgs^ e) //Paint of Picturebox
{
if (btnBlackLine->CheckState == CheckState::Checked && viewPictureE->Image ) //blue line
{

this->isDrawing = false;
this->graph = this->viewPictureE->CreateGraphics();
graph->Flush();

}
}

void frmPictureEdit::PaintMouseDown(MouseEventArgs^ e)
{
if (btnBlackLine->CheckState == CheckState::Checked) //black line
{
//viewPictureE->Refresh();
this->startX = e->X;
this->startY = e->Y;
this->endX = e->X;
this->endY = e->Y;
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
this->isDrawing = true;

}
}

void frmPictureEdit::PaintMouseMove(MouseEventArgs^ e)
{
if (viewPictureE->Image && btnBlackLine->CheckState == CheckState::Checked)
{
if( !this->isDrawing )
return;
//viewPictureE->Refresh();
System::Drawing::Bitmap ^image1 = gcnew System::Drawing::Bitmap(this->viewPictureE->Image);
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
//viewPictureE->Invalidate();
}
}


void frmPictureEdit::PaintMouseUp(MouseEventArgs^ e)
{
if (btnBlackLine->CheckState == CheckState::Checked)
{
endX = e->X;
endY = e->Y;
graph->DrawLine(Pens::Black, startX, startY, endX, endY);
this->isDrawing = false;
}
}

The Image is loaded into an Picturebox. I created a new instance of the graphics and Bitmap object!Im basically drawing it on the graphics objects.

Can you please tell me exactly where Im going wrong???

Will be really appreciated!!

ArianN


GeneralRe: Draw line on image!!!!!!!!!! Pin
Christian Graus23-Feb-06 16:18
protectorChristian Graus23-Feb-06 16:18 
GeneralRe: Draw line on image!!!!!!!!!! Pin
ArianN23-Feb-06 16:36
ArianN23-Feb-06 16:36 
GeneralRe: Draw line on image!!!!!!!!!! Pin
ArianN23-Feb-06 21:01
ArianN23-Feb-06 21:01 
QuestionSharing structs/enums between .NET languages Pin
Andre xxxxxxx21-Feb-06 12:16
Andre xxxxxxx21-Feb-06 12:16 
AnswerRe: Sharing structs/enums between .NET languages Pin
George L. Jackson21-Feb-06 13:21
George L. Jackson21-Feb-06 13:21 
QuestionRead/Write Dmi Pool Area - Bios Pin
honae21-Feb-06 9:49
honae21-Feb-06 9:49 
AnswerRe: Read/Write Dmi Pool Area - Bios Pin
George L. Jackson21-Feb-06 13:26
George L. Jackson21-Feb-06 13:26 
QuestionSMBIOS - DMI Pin
honae21-Feb-06 8:45
honae21-Feb-06 8:45 
AnswerRe: SMBIOS - DMI Pin
George L. Jackson21-Feb-06 13:29
George L. Jackson21-Feb-06 13:29 
QuestionDMI Development Pin
honae21-Feb-06 7:36
honae21-Feb-06 7:36 
AnswerRe: DMI Development Pin
George L. Jackson21-Feb-06 13:31
George L. Jackson21-Feb-06 13:31 
QuestionVisibility of variables of type enumeration in Vc++ .net Pin
bejijou20-Feb-06 21:13
bejijou20-Feb-06 21:13 
AnswerRe: Visibility of variables of type enumeration in Vc++ .net Pin
George L. Jackson21-Feb-06 13:34
George L. Jackson21-Feb-06 13:34 
Questionprint current screen in c++ Pin
manish_27184520-Feb-06 17:22
manish_27184520-Feb-06 17:22 
AnswerRe: print current screen in c++ Pin
George L. Jackson21-Feb-06 13:36
George L. Jackson21-Feb-06 13:36 
QuestionPrinting using printdialog / printDocument HELP needed! Pin
ArianN20-Feb-06 15:36
ArianN20-Feb-06 15:36 
QuestionAuthentication Daemon in C/C++ Pin
Blessed_2320-Feb-06 12:07
Blessed_2320-Feb-06 12:07 

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.