473,765 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

extra line drawn to blob

Hi I got this code to read in a file to the database, if use it to save a
image from a picturebox to the database it works ok, but now I use it to
directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0 ) to coordinates(ima ge.width,0) when I look at the blob field
using crystal reports 9, the line normaly isn't there.What am I doing wrong?

Dim ms As System.IO.Memor yStream
Dim arrImg As Byte()
Dim img As Bitmap

If File.Exists(myP ath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing

img = DirectCast(Imag e.FromFile(myPa th), Bitmap)
img.Save(ms, img.RawFormat.B mp)
arrImg = ms.GetBuffer()
ms.Close()
End If

thanks in advance
Peter Proost

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
Nov 21 '05 #1
3 1713
I mean image not file
Hi I got this code to read in a file to the database, if use it to save a
Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:uG******** ******@TK2MSFTN GP15.phx.gbl... Hi I got this code to read in a file to the database, if use it to save a
image from a picturebox to the database it works ok, but now I use it to
directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0 ) to coordinates(ima ge.width,0) when I look at the blob field using crystal reports 9, the line normaly isn't there.What am I doing wrong?
Dim ms As System.IO.Memor yStream
Dim arrImg As Byte()
Dim img As Bitmap

If File.Exists(myP ath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing

img = DirectCast(Imag e.FromFile(myPa th), Bitmap)
img.Save(ms, img.RawFormat.B mp)
arrImg = ms.GetBuffer()
ms.Close()
End If

thanks in advance
Peter Proost

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

Nov 21 '05 #2
Just to say it seems that it has got nothing to do with my save method,
because if I load the image from the database it displays ok, it's just not
showing ok in crystal reports 9

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:ud******** ******@TK2MSFTN GP12.phx.gbl...
I mean image not file
Hi I got this code to read in a file to the database, if use it to save a

Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:uG******** ******@TK2MSFTN GP15.phx.gbl...
Hi I got this code to read in a file to the database, if use it to save

a image from a picturebox to the database it works ok, but now I use it to
directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0 ) to coordinates(ima ge.width,0) when I look at the blob

field
using crystal reports 9, the line normaly isn't there.What am I doing

wrong?

Dim ms As System.IO.Memor yStream
Dim arrImg As Byte()
Dim img As Bitmap

If File.Exists(myP ath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing

img = DirectCast(Imag e.FromFile(myPa th), Bitmap)
img.Save(ms, img.RawFormat.B mp)
arrImg = ms.GetBuffer()
ms.Close()
End If

thanks in advance
Peter Proost

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.


Nov 21 '05 #3
Hi just to let know I found then problem:
img.Save(ms, img.RawFormat.B mp)
if change that with this:

img.Save(ms, img.RawFormat.J peg)

the extra line isn't drawn in crystal reports

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:ef******** ******@TK2MSFTN GP10.phx.gbl...
Just to say it seems that it has got nothing to do with my save method,
because if I load the image from the database it displays ok, it's just not showing ok in crystal reports 9

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:ud******** ******@TK2MSFTN GP12.phx.gbl...
I mean image not file
Hi I got this code to read in a file to the database, if use it to
save
a

Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam .hotmail.com> schreef in bericht
news:uG******** ******@TK2MSFTN GP15.phx.gbl...
Hi I got this code to read in a file to the database, if use it to
save a image from a picturebox to the database it works ok, but now I use it
to directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0 ) to coordinates(ima ge.width,0) when I look at the blob

field
using crystal reports 9, the line normaly isn't there.What am I doing

wrong?

Dim ms As System.IO.Memor yStream
Dim arrImg As Byte()
Dim img As Bitmap

If File.Exists(myP ath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing

img = DirectCast(Imag e.FromFile(myPa th), Bitmap)
img.Save(ms, img.RawFormat.B mp)
arrImg = ms.GetBuffer()
ms.Close()
End If

thanks in advance
Peter Proost

--
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to

produce bigger and better idiots. So far, the Universe is winning.



Nov 21 '05 #4

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

Similar topics

10
1733
by: Tank | last post by:
First off let me say that I am by no means a skilled programmer so i probably have made a dozen mistakes in my attempt at coding my problem. I will tell you the problem so that you have an idea of what i am trying to do and I will give you my code so you can see my clusterf*ck. Here is the problem: At work I have about 20 photographers who work for me. Each one has a photo idea number (mine is 102 and my bosses is 101 and my...
2
11263
by: Anand Ganesh | last post by:
Hi All, In my application I am allowing the user to draw a line. But when the user clicks the start point and starts moving the mouse there is a series of line generated. When the mouse is up the final line is drawn. How to avoid the series of lines being generated during mouse move event? How to get the rubberband effect when the user moves the mouse? I tried using the ControlPaint.Reversible line but this does not help
3
8361
by: Lucas Tam | last post by:
Is there a divider control in VB.NET similar to a Horizontal Line in HTML? In the About Box of VS.NET, there is a divider line at the bottom of the page. -- Lucas Tam (REMOVEnntp@rogers.com) Please delete "REMOVE" from the e-mail address when replying. http://members.ebay.com/aboutme/coolspot18/
0
1241
by: alexandre_irrthum | last post by:
Hi there, I am puzzled by the comportment of the line function from the ImageDraw module with regard to the way it draws or does not draw the last pixel of a line. Below I test this function on a 3x3 image and show schematic representations of obtained images (where o means a drawn pixel) import Image, ImageDraw
3
2399
by: Bob Greschke | last post by:
I've resorted to actually drawing all of the characters of the alphabet on a graph to avoid having to drag around font files. It's mostly just uppercase characters, so it's not too bad. But I noticed that some of the line segments have to be extended one pixel longer than they should be in order for the last pixel to show up. The character cells are 6 pixels wide by 8 pixels high. An "L" is drawn with
1
1629
by: alexandre_irrthum | last post by:
Hi there, Sorry to repost this, but I didn't get any answer one month ago. In essence, it seems that the ImageDraw line function draws lines one pixel shorter in some circumstances. This could be very annoying for some applications where precise geometry does matter. Below I test this function on a 3x3 image and show schematic representations of obtained images (where o means a drawn pixel)
2
6534
by: Vinciz | last post by:
hi guys... im new in java and i would love to learn some of these... basically i got a sample code to retrieve the blob from the mysql. however, i dont really know what to do with these retrieved byte/binary data as i got no idea on how to save them in our pc. For this situation, what i need to do is give the byte/binary data an extension (retrieved from another field in the table) in order to revert back to the original data i had in the...
2
1978
by: rkgarimella9 | last post by:
Friends, i'm facing with a severe problem while coding an windows application. the problem is that i'm using a usercontrol consisting of three labels upon which three images are placed. the problem is when i'm attempting to draw a line from that usercontrols one of the labels image to the other similar control, the line is getting drawn, but the line is being drawn from the behind of the control, but its not coming on top of the control....
3
1397
by: Piotrekk | last post by:
Hi Graphics pea = e.Graphics; Point ptTable = { pictureBox1.Location , new Point(pictureBox1.Location.X + pictureBox1.Width,pictureBox1.Location.Y + pictureBox1.Height) }; pea.DrawLines(new Pen(Brushes.Black, 1), ptTable);
0
10007
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...
1
9955
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9833
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
8831
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...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.