converting image in Binary file - Programmers Heaven

Howdy, Stranger!

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

Categories

converting image in Binary file

irfans786irfans786 Posts: 12Member
can any one help me to convert the bitmap image to convert in Binary file.
I got the image in clipboard and i can also paste the image in Picture BOX. but i want to store the image in a binary file from the clipboard.
help me Out......

Thanks..........

Comments

  • GenjuroGenjuro Posts: 913Member
    : can any one help me to convert the bitmap image to convert in Binary file.
    : I got the image in clipboard and i can also paste the image in Picture BOX. but i want to store the image in a binary file from the clipboard.
    : help me Out......
    :
    : Thanks..........

    There is the SaveBitmap function, that saves the contents of a PictureBox to a .bmp file - which is a binary format.
    Other than this, you have to write your own routine.
  • MicroDotMicroDot Posts: 142Member
    : can any one help me to convert the bitmap image to convert in Binary file.
    : I got the image in clipboard and i can also paste the image in Picture BOX. but i want to store the image in a binary file from the clipboard.
    : help me Out......
    :
    : Thanks..........
    :
    Try this snippet

    [code]

    Private Sub SaveBMP(ByVal strImage As String)
    Picture = Clipboard.GetData(vbCFBitmap)
    SavePicture Picture, strImage
    End Sub

    [/code]

    [hr]

    [b][blue]//MicroDot[/blue][/b]

  • irfans786irfans786 Posts: 12Member
    Thanx dear....

    Hey tell me how to store the image in SQL server 2000 database.. by using ADO.. I am having image in a image control now i want to store it in database. and when required it must be retirved in the Image control again...

    Irfan
  • MicroDotMicroDot Posts: 142Member
    : Thanx dear....
    :
    : Hey tell me how to store the image in SQL server 2000 database.. by using ADO.. I am having image in a image control now i want to store it in database. and when required it must be retirved in the Image control again...
    :
    : Irfan
    :
    Store it as a BLOB

    [hr]

    [b][blue]//MicroDot[/blue][/b]

  • irfans786irfans786 Posts: 12Member
    I have taken the feild as Image(equivalent to BLOB).
    1st i am storing the image in binary file then by reading that file i am inserting it it a byte array.. but its not working properly...as we dont know what will the size of binary string.. how will i store the binary string in Database using Recordset. I found Getchunk method but cant code it properly.. do u have a code for this??
  • MicroDotMicroDot Posts: 142Member
    : I have taken the feild as Image(equivalent to BLOB).
    : 1st i am storing the image in binary file then by reading that file i am inserting it it a byte array.. but its not working properly...as we dont know what will the size of binary string.. how will i store the binary string in Database using Recordset. I found Getchunk method but cant code it properly.. do u have a code for this??
    :

    Can you provide your code you have sofar to store the BLOB?

    [hr]

    [b][blue]//MicroDot[/blue][/b]

  • irfans786irfans786 Posts: 12Member
    Hey man i have completed the work. actually i was making a small mistake while storing the image . Now its all working fine. Thanks for Replying
    Irfan
Sign In or Register to comment.