473,890 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert IMAGE object to STRING for manipulation?

Hi, I have a vb.net program made to grab screenshots and then store them in
image objects.
The image is displayed in a pictureBox atm but I want to store the data in a
String only.

(Without saving to a file on HDD, then loading it as binary)

Does anyone know how to convert an image into a string & have any pointers
to information on how the image would look when in the string (Like bit
patterns, etc)?

--
Trammel is a member of DWC (http://dwc.no-ip.org)
(Please reply to group only)
Nov 21 '05 #1
5 14634
Hi:

I use the ToBase64String function to convert the image stored in the
database to string;

System.Convert. ToBase64String( CType(dr(i), Byte()))

Hope this help
JCVoon

Trammel wrote:
Hi, I have a vb.net program made to grab screenshots and then store them in
image objects.
The image is displayed in a pictureBox atm but I want to store the data in a
String only.

(Without saving to a file on HDD, then loading it as binary)

Does anyone know how to convert an image into a string & have any pointers
to information on how the image would look when in the string (Like bit
patterns, etc)?

--
Trammel is a member of DWC (http://dwc.no-ip.org)
(Please reply to group only)


Nov 21 '05 #2
Code:
imgStr = System.Convert. ToBase64String( CType(img, Byte()))

Returns error:
E:\...\ScreenCa pture.vb(88): Value of type 'System.Drawing .Image' cannot be
converted to '1-dimensional array of Byte'.

"jcvoon" <jc*******@yaho o.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hi:

I use the ToBase64String function to convert the image stored in the
database to string;

System.Convert. ToBase64String( CType(dr(i), Byte()))

Trammel wrote:
Hi, I have a vb.net program made to grab screenshots and then store them in image objects.
The image is displayed in a pictureBox atm but I want to store the data in a String only.

(Without saving to a file on HDD, then loading it as binary)

Does anyone know how to convert an image into a string & have any pointers to information on how the image would look when in the string (Like bit
patterns, etc)?

Nov 21 '05 #3
Code:
imgStr = System.Convert. ToBase64String( CType(img, Byte()))

Returns error:
E:\...\ScreenCa pture.vb(88): Value of type 'System.Drawing .Image' cannot be
converted to '1-dimensional array of Byte'.

"jcvoon" <jc*******@yaho o.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hi:

I use the ToBase64String function to convert the image stored in the
database to string;

System.Convert. ToBase64String( CType(dr(i), Byte()))

Trammel wrote:
Hi, I have a vb.net program made to grab screenshots and then store them in image objects.
The image is displayed in a pictureBox atm but I want to store the data in a String only.

(Without saving to a file on HDD, then loading it as binary)

Does anyone know how to convert an image into a string & have any pointers to information on how the image would look when in the string (Like bit
patterns, etc)?

Nov 21 '05 #4
Hi:

you need to convert the image to byte array

Dim abyt As Byte()
Dim ms As New IO.MemoryStream
Dim bmp As New Bitmap("yourbit map.bmp")

bmp.Save(ms, Imaging.ImageFo rmat.Bmp)

abyt = ms.ToArray()
E:\...\ScreenCa pture.vb(88): Value of type 'System.Drawing .Image' cannot be
converted to '1-dimensional array of Byte'.


Nov 21 '05 #5
Hi:

you need to convert the image to byte array

Dim abyt As Byte()
Dim ms As New IO.MemoryStream
Dim bmp As New Bitmap("yourbit map.bmp")

bmp.Save(ms, Imaging.ImageFo rmat.Bmp)

abyt = ms.ToArray()
E:\...\ScreenCa pture.vb(88): Value of type 'System.Drawing .Image' cannot be
converted to '1-dimensional array of Byte'.


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1513
by: Mullin Yu | last post by:
now, i want to create a Image object, which is a white rectangle with a specific size of area, and a black string or barcode will be on it. any api or sample code or ideas? thanks!
2
7571
by: Bruno Rodrigues | last post by:
Hi, Can I save an image in the database, without saving it first in the hard disk? Thanks, Bruno Rodrigues.
1
5427
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a web form to upload a TIFF image (scanned images) and convert it to a JPEG before I insert it into SQL Server. The file upload part works great, but I can;t convert the image. I certainly don't want to upload it the the server filesystem, convert...
2
2646
by: UJ | last post by:
I have need to convert a text string (with formatting) to an image. This is so that I can resize the image to different sizes and the formatting stays exactly the same regardless of the size. I actually want the font size to increase/decrease as the image grows/shrinks much the way text does in a flash object. Is there an easy way to do this programmatically? It needs to be done behind the scenes on my web site - user enters some text - I...
1
681
by: Trammel | last post by:
Hi, I have a vb.net program made to grab screenshots and then store them in image objects. The image is displayed in a pictureBox atm but I want to store the data in a String only. (Without saving to a file on HDD, then loading it as binary) Does anyone know how to convert an image into a string & have any pointers to information on how the image would look when in the string (Like bit patterns, etc)?
5
9659
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to text. The user may "convert image to text" and copy and paste the text displayed into any word document, or send the text displayed to the recipient's email address or can download the text file as a zipped text file that will be presented to...
4
3504
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if substrings need be replaced, or one character needs be changed, what shall I do? Is it better to convert strings to UCS-32 before manipulation? But on Windows, wchar_t is 16 bits which isn't enough for characters which can't be simply encoded...
0
1812
by: madumm | last post by:
Hi All; String newImagePath = "C:\temp\abc.bmp" File filePath = new File(newImagePath); Image watermarkImg = Toolkit.getDefaultToolkit().getImage(filePath.toURL()); Any how i want convert this file in the "newImagePath " to a BufferedImage. I tried to create a Image object and then convert into BufferedImage but it didn't work.
0
1468
by: norseman | last post by:
Daniel de Sousa Barros wrote: ================================================ Click Start/settings/control panel/system/advanced/settings(in \ performance area)/advanced/change set System managed size on click SET box to right of above line click positives (OK APPLY etc.) all way out, system will probably reboot
0
9980
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10830
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9641
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6061
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.