473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Working With Pictures

EdB
Does anyone have any good examples of code for this type of situation?

I have a data table that stores information about individuals. I also have
the need to store a picture of the individual for display and ID badge
printing.

#1, I found it discouraging that the Picture Box control did not support
Drag And Drop. Any thoghts here?

#2, How do you store a picture to a SQL table?

Thanks in advance.
Nov 21 '05 #1
4 1703
Hi,

the picturebox supports D&D.
You can try the 101 free samples of VB.NET. One sample uses D&D.
http://msdn.microsoft.com/vbasic/dow...s/default.aspx

To read and write a picture into database;
(read)
http://support.microsoft.com/kb/317670/EN-US/
(read & write with BLOB)
http://support.microsoft.com/kb/308042/EN-US/
(write)
http://www.theserverside.net/discuss...hread_id=24962

I hope that helps.

Kind regards,

Jorge Serrano
MVP VB.NET
"EdB" wrote:
Does anyone have any good examples of code for this type of situation?

I have a data table that stores information about individuals. I also have
the need to store a picture of the individual for display and ID badge
printing.

#1, I found it discouraging that the Picture Box control did not support
Drag And Drop. Any thoghts here?

#2, How do you store a picture to a SQL table?

Thanks in advance.

Nov 21 '05 #2
EdB,

For the drag and drop see the samples on MSDN.

Here beneath my complete sample for everything with a Blob about reading and
writing to a Dataset (and with that to an SQL server) avoiding in my idea
some extra processing that is in the samples on MSDN.

http://groups.google.com/groups?selm...TNGP11.phx.gbl

I would use instead of complete images thumbnails for your problem, maybe
you can see the sample snippet bellow as an extention form the code in the
message above,

\\\
Dim arrImage() As Byte = DirectCast(rdr.Item("Photo"), Byte())
Dim ms1 As New System.IO.MemoryStream(arrImage)
Dim origimage As System.drawing.Image =
System.Drawing.Image.FromStream(ms1)
Dim PThumbnail As System.drawing.Image
PThumbnail = origimage.GetThumbnailImage(100, 100, Nothing, New IntPtr)
ms2 As New System.IO.MemoryStream
PThumbnail.Save(ms2, Imaging.ImageFormat.Bmp)
arrImage = ms2.GetBuffer
///

I hope this helps a little bit?

Cor
Nov 21 '05 #3
EdB
Thanks Jorge & Cor.

I'm sure the answers I seek are in your posts.

I based the following comment:
#1, I found it discouraging that the Picture Box control did not support
Drag And Drop. Any thoghts here?
On the fact that controls such as the TextBox have an AllowDrop property and
the picture does not.

Ed

"EdB" wrote:
Does anyone have any good examples of code for this type of situation?

I have a data table that stores information about individuals. I also have
the need to store a picture of the individual for display and ID badge
printing.

#1, I found it discouraging that the Picture Box control did not support
Drag And Drop. Any thoghts here?

#2, How do you store a picture to a SQL table?

Thanks in advance.

Nov 21 '05 #4
Hello

#1, I found it discouraging that the Picture Box control did not support
Drag And Drop. Any thoghts here?
Its been a while since i have used the picture box control. Are you sure this is correct?
Picturebox inherits from control and so it would have available drag drop members associated with
it.
#2, How do you store a picture to a SQL table?

You basically just split your image into a byte array and store that in the db.

Heres and example:

http://www.dotnet247.com/247referenc...ashCardsMG.asp
Nov 21 '05 #5

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

Similar topics

4
by: Mike | last post by:
hopefully this is an easy one to solve and I'm just missing something little... basically, I had a nice little website running with php, apache, etc... that uses imagecreatefromjpeg to create...
6
by: Stijn Goris | last post by:
HI all, I have created a script that allows a user to upload a picture. I have an IIS server runing on my own pc but the actual site runs an Apache server. The upload script worked perfectly on...
1
by: Mudcat | last post by:
I have an image that displays on a canvas that works unless I put the same code in a class. I can't figure that out. Here's what works: def uts5100(self): self.screen = Toplevel( self.master )...
0
by: JakeC | last post by:
Hey all, I'm currently redesigning a website that a friend and I started about a year ago. It is a daily surf report so when choosing the best script/language to use for the new design, I found...
0
by: Marcel - IDUG Europe 2005 | last post by:
Visit the blog for a virtual experience of the conference. Check out the blog at: http://idugeurope.blogspot.com Here are some previous posts: - Pictures Live on Tuesday
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
4
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures...
3
by: rudeman76 | last post by:
Hello, I am working on an incident form. I have 4 set text boxes and up to 4 drop-down boxes on the form. The user enters in the date then time. I have 4 option buttons for the user to select...
7
by: Ja NE | last post by:
(as first - thank you for all your help several years ago, and second - please apologise me for my clumsy enlgish) so, preface: some users on my photo related site sometimes enter (link) giant...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.