Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Saving picture to SQL (PictureBox) GDI Error

Saving picture to SQL (PictureBox) GDI Error

Scheduled Pinned Locked Moved C#
databasehelpwinformsgraphicsdata-structures
27 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Xmen Real

    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%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

    ----------------------------------------------- 128 bit encrypted signature, crack if you can

    L Offline
    L Offline
    Luc Pattyn
    wrote on last edited by
    #21

    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


    X 1 Reply Last reply
    0
    • L Luc Pattyn

      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


      X Offline
      X Offline
      Xmen Real
      wrote on last edited by
      #22

      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%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

      ----------------------------------------------- 128 bit encrypted signature, crack if you can

      1 Reply Last reply
      0
      • L Luc Pattyn

        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


        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #23

        Now I take it you can not only write an image to a panel, but you can retrieve an image from it?

        X L 2 Replies Last reply
        0
        • L Luc Pattyn

          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


          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #24

          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%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

          ----------------------------------------------- 128 bit encrypted signature, crack if you can

          1 Reply Last reply
          0
          • L Lost User

            Now I take it you can not only write an image to a panel, but you can retrieve an image from it?

            X Offline
            X Offline
            Xmen Real
            wrote on last edited by
            #25

            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%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

            ----------------------------------------------- 128 bit encrypted signature, crack if you can

            1 Reply Last reply
            0
            • L Lost User

              Now I take it you can not only write an image to a panel, but you can retrieve an image from it?

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #26

              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


              L 1 Reply Last reply
              0
              • L Luc Pattyn

                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


                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #27

                ohh.. ok that sounds like something I might be able to use to show a picture of our floor plan. Thanks for all of your guys help

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups