Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18011
Number of posts: 55384

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
converting image in Binary file Posted by irfans786 on 19 Aug 2004 at 2:29 AM
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..........
Report
Re: converting image in Binary file Posted by Genjuro on 19 Aug 2004 at 2:37 AM
: 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.
Report
Re: converting image in Binary file Posted by MicroDot on 19 Aug 2004 at 4:12 AM
: 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


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






//MicroDot

Report
Re: converting image in Binary file Posted by irfans786 on 21 Aug 2004 at 8:11 AM
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
Report
Re: converting image in Binary file Posted by MicroDot on 22 Aug 2004 at 3:12 AM
: 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




//MicroDot

Report
Re: converting image in Binary file Posted by irfans786 on 26 Aug 2004 at 8:57 AM
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??
Report
Re: converting image in Binary file Posted by MicroDot on 26 Aug 2004 at 10:47 AM
: 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?




//MicroDot

Report
Re: converting image in Binary file Posted by irfans786 on 5 Sept 2004 at 9:15 AM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.