Saving picture to SQL (PictureBox) GDI Error
-
well, If you're a pro programmer then you should use the appropriate control. PB is for pictures and panel for containing other controls. Am I wrong...? All the operations you're doing with Panel can be done with PB but since Panel is more powerful in itself, its not good to compare with PB. Its like byte(PB) and int(Panel).
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
Xmen wrote:
you should use the appropriate control.
Yes, when available.
Xmen wrote:
PB is for pictures and panel for containing other controls.
A PB can hold other controls as well. So it is doing (or trying to do) more than what a Panel does. When not containing other Controls, a Panel is just like a piece of canvas, ideal for painting and drawing whatever you want. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
Hi, there are lots of articles that demonstrate how to paint things. My Sokoban article is a simple example, the playing board actually is a Panel. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
Luc Pattyn wrote:
My Sokoban article is a simple example
nice work man, you got ma 5 ;)
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
Hi, there are lots of articles that demonstrate how to paint things. My Sokoban article is a simple example, the playing board actually is a Panel. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
Xmen wrote:
you should use the appropriate control.
Yes, when available.
Xmen wrote:
PB is for pictures and panel for containing other controls.
A PB can hold other controls as well. So it is doing (or trying to do) more than what a Panel does. When not containing other Controls, a Panel is just like a piece of canvas, ideal for painting and drawing whatever you want. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
Luc Pattyn wrote:
A PB can hold other controls as well.
aye aye but not like panel...you have to add programmatically.
Luc Pattyn wrote:
When not containing other Controls, a Panel is just like a piece of canvas, ideal for painting and drawing whatever you want.
aha but no support for gif ;) but no worries, this is end of discussion
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
Now I take it you can not only write an image to a panel, but you can retrieve an image from it?
simple drawing method Draw image and set it to global variable. Then in OnPaint() draw that image. In this way, you can have image anytime. But if you just want to set a single image from file or stream, I'll suggest you to use BackgoundImage property. No coding required. Plus you can use styles, Tiles, Center, Zoom...etc
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
Now I take it you can not only write an image to a panel, but you can retrieve an image from it?
Hi Jacob, first of all, if you have code to paint/draw something (that is a "Paint handler" which is called automatically with a "Graphics" parameter), you have all the information and the same code could be used to draw onto another Graphics object, e.g. one you obtain from Bitmap.CreateGraphics(). Furthermore there is a Control.DrawToBitmap() method available for all Controls, it creates a bitmap showing the Control the way it looks on screen. Since a Panel does not draw anything by itself, Panel.DrawToBitmap() paints your own content to the bitmap, which is quite handy. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
Hi Jacob, first of all, if you have code to paint/draw something (that is a "Paint handler" which is called automatically with a "Graphics" parameter), you have all the information and the same code could be used to draw onto another Graphics object, e.g. one you obtain from Bitmap.CreateGraphics(). Furthermore there is a Control.DrawToBitmap() method available for all Controls, it creates a bitmap showing the Control the way it looks on screen. Since a Panel does not draw anything by itself, Panel.DrawToBitmap() paints your own content to the bitmap, which is quite handy. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets