Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HOW TO:Display Images stored in a Blob Fields

dipdududipdudu Member Posts: 1
i need a help in displaying an image stored in a blob using mySQL in visual C++ MFC.i need to know a step-by-step techniques starting with saving an image in blob,loading it,details example and all the syntax required. thank you

Comments

  • JonathanJonathan Member Posts: 2,914
    : i need a help in displaying an image stored in a blob using mySQL in visual C++ MFC.i need to know a step-by-step techniques starting with saving an image in blob,loading it,details example and all the syntax required. thank you
    :
    I'm not familiar with C++ MFC in any way, shape or form beyond knowing it's an OO way of getting at the Windows API. :-)

    One approach would be to simply take the image file, load it into memory and then, if the C++ MySQL driver does place holders, pass that data as one of the place holders in your query. I think MySQL has a way of loading data into a blob directly from a file too.

    To display it, you need to fetch it from the database into memory. I believe one of the GDI/graphics functions allows for displaying an image that is stored in memory, though I couldn't tell you what it's called (sorry, I'm kinda useless...) Thinking about it, it might be more like creating a copy of the image in memory then bitblt'ing it onto your window. Alternatively, write it back out to a temporary file then display it as you'd display any image file.

    Hope this helps a little,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.