|
how can i convert image exists in picturebox into bitstream using array function.
|
|
|
|
|
Hi...
i do not know what exactly you mean by array function... I am taking it as you want the picture to be stored in a array of bytes...
Plz look at the sample code...
'Define a memory stream
Dim ms As MemoryStream = New MemoryStream()
'Get the image into ms from picture box
pic.Image.Save(ms, pic.Image.RawFormat.Gif)
'Define a byte stream of length of memory stream and transfer the ms to it
Dim bytesA(CInt(ms.Length - 1)) As Byte
ms.Seek(0, SeekOrigin.Begin)
ms.Read(bytesA, 0, CInt(ms.Length))
ms.Dispose()
Good luck
|
|
|
|
|
i need to convert the image into points .
|
|
|
|
|
Ok... for that you have to read every pixel of the image and store the location and color of it...
I had not tried that out... but for sure it is possible...
But why do u want to do it that ways???
If u just need the image to be recreated at destination this will solve ur purpose..
Regards
Nishkarsh
|
|
|
|
|
i had tried , but i couldn't so i asked help
i want this this way cause i thought it is the easiest one
so plz if u've any ideas forward it to me and i'll be greatful
thanks anyway.
|
|
|
|
|
sorry for late reply... i was out in the weekend...
I can tel what i am doing.... My objective was to read the image as binary data and fire a query to store it and read back to display form a DB...
If this is of any use then i will send u the sample code...
|
|
|
|
|
thanx alot & am deeply sry for bothering you,
plz send me the sample code & i need the (Imports system *) that i can use it with images .
cause i couldn't run any code without it .
am not familliar with VB.net , but i've to learn it .
thanx anyway.
|
|
|
|
|
Code to read the IMAGE from PICTURE BOX
Imports System
Imports System.IO
Imports System.Text
'Declare a memory stream
Dim ms As MemoryStream = New MemoryStream()
'Get the image into ms from picture box (Treating it as a gif, you can chuse ur format)
picBox.Image.Save(ms, picBox.Image.RawFormat.Gif)
'Define a byte stream of length of memory stream and tranfer the ms to it
Dim bytes(CInt(ms.Length - 1)) As Byte
ms.Seek(0, SeekOrigin.Begin)
ms.Read(bytes, 0, CInt(ms.Length))
ms.Dispose()
So this code will make it sure that you have the image in a array of bytes and you can do what u want with it..
Once you read the picture back from DB as byte array you can display it as
Dim ar(dataLength) As Byte
myReader.GetBytes(0, 0, ar, 0, dataLength)
myReader.Close()
'Define a memory stream
Dim b As New MemoryStream(ar)
picBOx.Image = Image.FromStream(b)
b.Close()
Good Luck
Nishkarsh
|
|
|
|
|
really thanx alot dear ,
may i ask your help again when i need it ???
|
|
|
|
|
hi how r u ??
sry for botering u , but i need to ask 2 questions
1-how can i compress an image using VB.NET ??????
2-what is the imports system.* that i can use it with this statment:
picturebox.image=system.drawing.image.fromfile(openfiledialog.filename)
|
|
|
|
|
i need the VB.net code for the camera program which exists in the pocket pc that drive the picturing and recording applications.
it is important plz.
|
|
|
|
|
sorry i had not interacted with any camera till now... but if u get some codes like that plz do give me a sample....
|
|
|
|
|
i need something called POCKET PC OCX .
plz if u know anything about it forward it to me .
thanx anyway
|
|
|
|
|
Sorry .
I need the functions that i can start my code with.
|
|
|
|
|
Seriously, you need to learn how to use the "reply" button.
(For anyone who is interested the conversation is spread throughout the forum: first here[^] and then here[^])
|
|
|
|
|
Hmmm, if he graduates, he is a graduate to avoid since he cannot seem to do the project on his own, let alone keep replies in one thread
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
Ok, here you go
Start()
Work()
End()
Set Graduate = FAIL
If you want some one to write code, employ a programmer - rent a coder is a good site.
Also, at the bottom of each posting here is a link called Reply. Guess what it is for?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
In My application i want to text wheather there are more occurences of '{' than '}' or vice
versa in a rich text box.
How would I go about finding how often each of these charcters occurs?
|
|
|
|
|
Oh... I've just figured it out all by myself
Here's the code if it's useful to anyone else:
'-------------------------------------------------------------------------------
Function FindInstance(ByVal CharacterToFind As String)
Dim Counter As Integer = 0
Dim CurrentPosition As Integer = 0
Dim InstanceCounter As Integer = 0
While Counter < CodeView.TextLength
CodeView.SelectionStart = CurrentPosition
CodeView.SelectionLength = CharacterToFind.Length
If CodeView.SelectedText = CharacterToFind Then
InstanceCounter += 1
End If
CodeView.SelectionLength = 0
CurrentPosition += 1
Counter += 1
End While
Return InstanceCounter
End Function
'--------------------------------------------------------------------------------------
Where 'CodeView' is the textbox/richtextbox being searched.
|
|
|
|
|
hi
sry i didn't understand ur answer
so will u explain it by detailed code in VB.NET
i need to convert the picture into 1's and 0's (points) and write code using array function then send it via GPRS connection . and i'll use UDP packet
|
|
|
|
|
What they mean is nobody is going to write your code for you, so it looks like you will not graduate.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
waz up
what's the question ?!
|
|
|
|
|
i need to convert the image into points.
|
|
|
|
|
witch image ?
" I love deadlines. I like the whooshing sound they make as they fly by. "
|
|
|
|