Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.