Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: PLEASE HELP trying to get data from xml using c# Pin
Xmen Real 2-Apr-09 16:00
professional Xmen Real 2-Apr-09 16:00 
QuestionSingle Elimination - Tournament Brackets Pin
aslamc2-Apr-09 9:29
aslamc2-Apr-09 9:29 
AnswerRe: Single Elimination - Tournament Brackets Pin
aslamc3-Apr-09 12:40
aslamc3-Apr-09 12:40 
GeneralRe: Single Elimination - Tournament Brackets Pin
Ed K13-Nov-12 12:38
Ed K13-Nov-12 12:38 
QuestionApplying Separator in Combo Box....help plz! [modified] Pin
Rajdeep.NET is BACK2-Apr-09 9:10
Rajdeep.NET is BACK2-Apr-09 9:10 
AnswerRe: Applying Separator in Combo Box....help plz! Pin
DaveyM692-Apr-09 10:09
professionalDaveyM692-Apr-09 10:09 
GeneralRe: Applying Separator in Combo Box....help plz! Pin
Rajdeep.NET is BACK2-Apr-09 10:49
Rajdeep.NET is BACK2-Apr-09 10:49 
QuestionDrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:03
Jacob Dixon2-Apr-09 9:03 
I am a little confused by this.. I get it to draw the lines on the panel, but when I try to save it to a file it is blank?

Here is my panels MouseMove:

private void panelSig_MouseMove(object sender, MouseEventArgs e)
{
    if (shouldPaint)
    {
        Graphics graphic = panelSig.CreateGraphics();
        Cursor.Clip = new Rectangle(this.PointToScreen(panelSig.Location), panelSig.Size);

        graphic.DrawLine(pen, lastPoint.X, lastPoint.Y, e.X, e.Y);
        graphic.Dispose();

        lastPoint.X = e.X;
        lastPoint.Y = e.Y;

        panelSig.Invalidate(new Rectangle(0, 0, panelSig.Width, panelSig.Height));

        Cursor.Clip = new Rectangle(0, 0, 0, 0);
    }
}


Here is the MouseDown and MouseUp:
private void panelSig_MouseDown(object sender, MouseEventArgs e)
{
    shouldPaint = true;
    lastPoint.X = e.X;
    lastPoint.Y = e.Y;
}

private void panelSig_MouseUp(object sender, MouseEventArgs e)
{
    shouldPaint = false;
}


But when I try to save it to a file it doesnt work?? I'm confused... I realy want to save it in a SQL database, but I figured I should get it to save to a file first to see.. It saves.... just the panel, not the actual lines I drew.

Here is how I am saving it:

Bitmap TestBMP = new Bitmap(panelSig.Width, panelSig.Height);
FileStream fs = new FileStream(saveFile.FileName, FileMode.Create, FileAccess.Write);
panelSig.DrawToBitmap(TestBMP, new Rectangle(0, 0, panelSig.Width, panelSig.Height));

TestBMP.Save(fs, ImageFormat.Png);
fs.Close();

AnswerRe: DrawLine on Panel? Not saving? Pin
Colin Angus Mackay2-Apr-09 9:21
Colin Angus Mackay2-Apr-09 9:21 
GeneralRe: DrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:23
Jacob Dixon2-Apr-09 9:23 
GeneralRe: DrawLine on Panel? Not saving? Pin
Colin Angus Mackay2-Apr-09 9:31
Colin Angus Mackay2-Apr-09 9:31 
GeneralRe: DrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:48
Jacob Dixon2-Apr-09 9:48 
QuestionBinding in-memory data to a DataGridView Pin
StevenS_Dev2-Apr-09 8:38
StevenS_Dev2-Apr-09 8:38 
AnswerRe: Binding in-memory data to a DataGridView Pin
Mycroft Holmes2-Apr-09 11:04
professionalMycroft Holmes2-Apr-09 11:04 
GeneralRe: Binding in-memory data to a DataGridView Pin
StevenS_Dev2-Apr-09 12:12
StevenS_Dev2-Apr-09 12:12 
GeneralRe: Binding in-memory data to a DataGridView Pin
Henry Minute2-Apr-09 15:04
Henry Minute2-Apr-09 15:04 
GeneralRe: Binding in-memory data to a DataGridView Pin
StevenS_Dev3-Apr-09 13:22
StevenS_Dev3-Apr-09 13:22 
Questioncalling method/event of one form from another Pin
Sandeep Kalra2-Apr-09 8:22
Sandeep Kalra2-Apr-09 8:22 
AnswerRe: calling method/event of one form from another Pin
Colin Angus Mackay2-Apr-09 9:17
Colin Angus Mackay2-Apr-09 9:17 
GeneralRe: calling method/event of one form from another Pin
Sandeep Kalra2-Apr-09 18:09
Sandeep Kalra2-Apr-09 18:09 
Questionnetworkable sign in sign out board C# Pin
Rafone2-Apr-09 6:25
Rafone2-Apr-09 6:25 
AnswerRe: networkable sign in sign out board C# Pin
Skymir2-Apr-09 9:47
Skymir2-Apr-09 9:47 
QuestionCSV File Splitter Help... Pin
Alistair Jarrett2-Apr-09 5:36
Alistair Jarrett2-Apr-09 5:36 
AnswerRe: CSV File Splitter Help... Pin
Judah Gabriel Himango2-Apr-09 5:52
sponsorJudah Gabriel Himango2-Apr-09 5:52 
AnswerRe: CSV File Splitter Help... Pin
Le centriste2-Apr-09 5:52
Le centriste2-Apr-09 5:52 

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.