Forum: VB.NET Aug 7th, 2009 |
| Replies: 39 Views: 3,936 Add declaration
Dim ImageByteArr(0) As Byte ' An array to hold image (bytes)
right before calling
Image2Byte(DrawingForm.BitmapCanvas, ImageByteArr)
' and after that
SaveByteArray(ImageByteArr,... |
Forum: VB.NET Aug 7th, 2009 |
| Replies: 39 Views: 3,936 No. Just more debugging needed.
Here's the same code with four messagebox "dumps" added
Public Sub Image2Byte(ByVal NewImage As Image, ByRef ByteArr() As Byte)
'
Dim ImageStream As... |
Forum: VB.NET Aug 5th, 2009 |
| Replies: 39 Views: 3,936 Yes, the image isn't saved correctly. Did you use adatapost's code (Post #9 in Saving Drawing on PictureBox to SQL Database (http://www.daniweb.com/forums/post911402-9.html)) for saving the image?
... |
Forum: VB.NET Aug 4th, 2009 |
| Replies: 39 Views: 3,936 I made a mistake in previous post. The code should have been
' Loads the image to the picture box control from SQL Server
Dim ImageByteArr(0) As Byte ' An array to hold image (bytes)
Dim patientIC... |
Forum: VB.NET Aug 3rd, 2009 |
| Replies: 39 Views: 3,936 I tested your code and it worked fine (Page2 form's code). I had to comment out all the data retrieval for labels to test btnSearch_Click but I don't believe that effects anything.
First, you did... |
Forum: VB.NET Aug 3rd, 2009 |
| Replies: 9 Views: 593 That's why you use ReDim Preserve to resize array/matrix and to preserve previously entered data.
First dimension has to be fixed. You can only change the second dimension.
Here's another... |
Forum: VB.NET Aug 3rd, 2009 |
| Replies: 9 Views: 593 ReDim works fine unless you have to resize 2-dimensional array more than once and preserve the previous content. That's a limitation by design.
For example
Dim Matrix(,) As Integer
ReDim... |
Forum: VB.NET Aug 2nd, 2009 |
| Replies: 9 Views: 593 Yes you can
Dim MyList As New ArrayList()
Dim Arr1() As Integer = {1, 2, 3}
Dim Arr2() As Integer = {4, 5, 6}
MyList.Add(Arr1)
MyList.Add(Arr2)
MsgBox(CType(MyList.Item(1), Integer())(2)) '... |
Forum: VB.NET Aug 1st, 2009 |
| Replies: 2 Views: 205 Here's a few things to fix first:
- add Option Strict On and Option Explicit On lines at the beginning of vb-file
- line 19: you refer to draggedlabel but you haven't declared it. Is it a label... |
Forum: VB.NET Aug 1st, 2009 |
| Replies: 39 Views: 3,936 Just for testing I had a main form (Form1) and a separate drawing form (Form2). You can use just one form. In that case you have to copy the drawing routines from (my) Form2 to your main (drawing)... |
Forum: VB.NET Jul 28th, 2009 |
| Replies: 6 Views: 662 I did some googling and found out that InkPicture control does not even have Image property :)
InkEdit control has SaveFile method (see Using InkEdit, InkPicture, and Enhancing the Appearance of... |
Forum: VB.NET Jul 25th, 2009 |
| Replies: 6 Views: 662 Ok, here's a step-by-step test which control is not set
If InkPicture1 IsNot Nothing Then
If InkPicture1.Image IsNot Nothing Then
InkPicture1.Image.Save(IO.Directory.GetCurrentDirectory() &... |
Forum: VB.NET Jul 23rd, 2009 |
| Replies: 39 Views: 3,936 Got it. The very basic principle is not to draw on a (picture box) control. Instead, you have to use some in-memory buffer (i.e. bitmap). You draw to the buffer and then display the buffer in the... |
Forum: VB.NET Jul 22nd, 2009 |
| Replies: 39 Views: 3,936 Damn :-O
Ok, I can think of two options. User drawings should be somehow merged to image before saving. They seem to be separate objects right now. I don't have code for that at the moment but... |
Forum: VB.NET Jul 22nd, 2009 |
| Replies: 11 Views: 354 Basically you're readind serial data from COM-port and that is equally easy (or difficult) task with VB.NET, VB6 and C++ (or C#).
Most of your application will deal with other things. Like UI,... |
Forum: VB.NET Jul 18th, 2009 |
| Replies: 6 Views: 662 I don't have a tablet PC to test with, but if things work in the same way as with WinForms, your code should be following
InkPicture1.Image.Save(IO.Directory.GetCurrentDirectory() & "\test_out.jpg",... |
Forum: VB.NET Jul 18th, 2009 |
| Replies: 39 Views: 3,936 If the code works, don't change it (if it ain't broke, don't fix it, you know ;) ) And like I posted before, Adatapost's code is pretty much same as mine.
I used the same form. That's why I... |
Forum: VB.NET Jul 16th, 2009 |
| Replies: 39 Views: 3,936 Here's a complete (example) code for saving a picture box control's image to SQL Server and loading it back
Option Strict On
Option Explicit On
Imports System.Drawing.Imaging ' Image related... |
Forum: VB.NET Jul 15th, 2009 |
| Replies: 39 Views: 3,936 Here's the repainting code. All the user drawings are saved on the arrays. On the picture box's paint event all the saved user drawings are repainted from the arrays
' "Drawing" arrays
Private... |
Forum: VB.NET Jul 13th, 2009 |
| Replies: 39 Views: 3,936 Maybe you shouldn't have quotes around CnStr (assuming it's a variable). Your code should be similar to
Dim CnStr As String
CnStr = "Data Source=MyMachineName\SQLEXPRESS; INITIAL... |
Forum: VB.NET Jul 9th, 2009 |
| Replies: 2 Views: 401 Did you get any exact error message?
You need MCI.ocx of course. Is it included in your installation package?
If you didn't distribute the MCI.ocx you used to develop your application,... |
Forum: VB.NET Jul 8th, 2009 |
| Replies: 39 Views: 3,936 If you use adatapost's code:
use the Image property of the picture box
'Write an image data into memory stream
pbBody.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
No,... |
Forum: VB.NET Jul 8th, 2009 |
| Replies: 39 Views: 3,936 Actually I'm not 100% sure. I haven't used the snippet in that kind of scenario, but I suggest you copy/paste the code(s) and try it out.
If I remember right, you were using picture box control... |
Forum: VB.NET Jul 7th, 2009 |
| Replies: 39 Views: 3,936 adatapost > OP cannot find a name of installed database.
The connection string seems ok to me :-/
Sorry, my mistake. It's called Image in SQL Server, not BLOB :) |
Forum: VB.NET Jul 7th, 2009 |
| Replies: 39 Views: 3,936 I suggest using BLOB data type.
convert image to an array of bytes first. See Save binary data to SQL Server with VB.NET... |
Forum: VB.NET Jul 5th, 2009 |
| Replies: 3 Views: 504 Hi! Nice to hear that you got answer to your problem. Could you please mark the thread as solved. Thank you! |
Forum: VB.NET Jul 5th, 2009 |
| Replies: 3 Views: 504 Didn't test it but if I remember right
oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")should be
oledbcom.CommandText = ("INSERT INTO Customer (Company,... |
Forum: VB.NET Jul 3rd, 2009 |
| Replies: 2 Views: 411 For the latter approach
use
Dim oCmd As SqlCommand
.
.
strSQL = "INSERT INTO <table> (<fields>) VALUES (<values>)"
strSQL = strSQL & "; SELECT @@IDENTITY AS 'Identity' "
oCmd.CommandText =... |
Forum: VB.NET Jun 29th, 2009 |
| Replies: 5 Views: 375 Could you please post your code and tell, which DB you're using. |
Forum: VB.NET Jun 18th, 2009 |
| Replies: 9 Views: 984 Damn :) I was able to reproduce it. The file contains (or starts) with a zero byte. That's why the first line looks like an empty string (but it isn't).
Try this
Dim myRequest As WebRequest =... |
Forum: VB.NET Jun 18th, 2009 |
| Replies: 9 Views: 984 I tested objReader.ReadToEnd with http://127.0.0.1/test.txt and it worked just fine. Of course you have to split the input to get separate lines. Anyway, objReader.ReadToEnd returned the whole... |
Forum: VB.NET Jun 17th, 2009 |
| Replies: 7 Views: 584 Actually you're saving incoming data to the memory stream, not in the temporary byte buffer. You should save the content of the memory stream.
Change this single line
If SaveFile("C:\my.gif",... |
Forum: VB.NET Jun 17th, 2009 |
| Replies: 9 Views: 984 Ok. I tried in my localhost Dim myRequest As WebRequest = WebRequest.Create("http://127.0.0.1/test.txt") and got no empty lines from text file with four lines of plain text.
I also asked, have you... |
Forum: VB.NET Jun 17th, 2009 |
| Replies: 4 Views: 391 Ok. Try to declare form variables global in your main form (Start form) i.e. where you have GotoForm. If you declare them inside the sub their scope will be only that sub and you "lose" the form... |
Forum: VB.NET Jun 17th, 2009 |
| Replies: 4 Views: 391 If you want to use the same procedure, pass a parameter to proc to tell which form to show
Public Sub GotoForm(ByVal FormIndex As Integer)
' Change form
Select Case FormIndex
Case 2
... |
Forum: VB.NET Jun 16th, 2009 |
| Replies: 9 Views: 984 I tried your code with Dim myRequest As WebRequest = WebRequest.Create("http://www.daniweb.com") and got no empty line as the first line.
Have you tried other URLs? What if you comment out... |
Forum: VB.NET Jun 16th, 2009 |
| Replies: 7 Views: 584 Never mind the code. Here's a (generic) function to save byte array to a file (VB.NET 2005 and newer)
Public Function SaveFile(ByVal FileName As String, ByRef Buffer() As Byte, ByVal OverWrite As... |
Forum: VB.NET Jun 16th, 2009 |
| Replies: 7 Views: 584 Could you please post your current image saving code. Thanks! |
Forum: VB.NET Jun 16th, 2009 |
| Replies: 9 Views: 1,050 Hi! Nice to hear that you got answer to your problem. Could you please mark the thread as solved. Thank you!
Not related to sockets. Please, start a new thread for a new question.
That's not... |
Forum: VB.NET Jun 15th, 2009 |
| Replies: 9 Views: 1,050 I was assuming VB.2005.
Oops!
Here's the modified client code. You can't send the whole file at once. You have to also send data in "chunks" (like you noticed in one of your messages). This... |