Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: Why does NullReferenceException throw irrelevantly? I already tried - no success. Pin
OriginalGriff22-Dec-20 1:12
mveOriginalGriff22-Dec-20 1:12 
AnswerRe: Why does NullReferenceException throw irrelevantly? I already tried - no success. Pin
Gerry Schmitz22-Dec-20 3:33
mveGerry Schmitz22-Dec-20 3:33 
SuggestionSQLLight vs SQL CE Pin
Alex Dunlop20-Dec-20 8:16
Alex Dunlop20-Dec-20 8:16 
GeneralRe: SQLLight vs SQL CE Pin
Gerry Schmitz20-Dec-20 9:19
mveGerry Schmitz20-Dec-20 9:19 
GeneralRe: SQLLight vs SQL CE Pin
Mycroft Holmes20-Dec-20 11:15
professionalMycroft Holmes20-Dec-20 11:15 
QuestionHow to save panel content into PDF Pin
RedPandinus19-Dec-20 17:46
RedPandinus19-Dec-20 17:46 
AnswerRe: How to save panel content into PDF Pin
OriginalGriff19-Dec-20 19:57
mveOriginalGriff19-Dec-20 19:57 
SuggestionRe: How to save panel content into PDF Pin
RedPandinus19-Dec-20 20:30
RedPandinus19-Dec-20 20:30 
private void button1_Click(object sender, EventArgs e)
       {
           Image bmp = new Bitmap(panel1.Width, panel1.Height);
           var gg = Graphics.FromImage(bmp);
           var rect = panel1.RectangleToScreen(panel1.ClientRectangle);
           gg.CopyFromScreen(rect.Location, Point.Empty, panel1.Size);
           bmp.Save("Test.jpg", ImageFormat.Jpeg);
           Graphics g = panel1.CreateGraphics();
           g.Clear(Color.White);
       }

Above is the click event does not create just panel area. It contains some parts of panel.
How can I get just panel area ? I just added the jpg file which button creates.

https://i.postimg.cc/Y0q0Xsp8/Test.jpg[^]

I am beginner at programming so please let me know if I have to elaborate more.

Maybe picturebox or canvas might be useful here I don't know and am open for advise.

My idea was to create .jpg and show it on pdf with using itextsharp.dll.

Thank you.

modified 20-Dec-20 2:40am.

GeneralRe: How to save panel content into PDF Pin
OriginalGriff19-Dec-20 22:57
mveOriginalGriff19-Dec-20 22:57 
GeneralRe: How to save panel content into PDF Pin
RedPandinus20-Dec-20 6:07
RedPandinus20-Dec-20 6:07 
GeneralAForge Motion Detection from PictureBox? Pin
Herboren19-Dec-20 17:15
Herboren19-Dec-20 17:15 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz19-Dec-20 21:51
mveGerry Schmitz19-Dec-20 21:51 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren20-Dec-20 6:09
Herboren20-Dec-20 6:09 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz20-Dec-20 9:30
mveGerry Schmitz20-Dec-20 9:30 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren20-Dec-20 12:47
Herboren20-Dec-20 12:47 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz21-Dec-20 6:52
mveGerry Schmitz21-Dec-20 6:52 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren21-Dec-20 8:31
Herboren21-Dec-20 8:31 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz21-Dec-20 8:57
mveGerry Schmitz21-Dec-20 8:57 
QuestionHow to make connection with SQL Server on another computer? Pin
Alex Dunlop17-Dec-20 9:14
Alex Dunlop17-Dec-20 9:14 
AnswerRe: How to make connection with SQL Server on another computer? Pin
BabyYoda17-Dec-20 9:20
BabyYoda17-Dec-20 9:20 
AnswerRe: How to make connection with SQL Server on another computer? Pin
DerekT-P17-Dec-20 10:16
professionalDerekT-P17-Dec-20 10:16 
QuestionComboBoxItem in another Form Pin
AnissGharib4917-Dec-20 2:09
AnissGharib4917-Dec-20 2:09 
AnswerRe: ComboBoxItem in another Form Pin
Dave Kreskowiak17-Dec-20 3:56
mveDave Kreskowiak17-Dec-20 3:56 
AnswerRe: ComboBoxItem in another Form Pin
OriginalGriff17-Dec-20 4:40
mveOriginalGriff17-Dec-20 4:40 
AnswerRe: ComboBoxItem in another Form Pin
Gerry Schmitz17-Dec-20 4:48
mveGerry Schmitz17-Dec-20 4:48 

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.