943,832 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 537
  • VB.NET RSS
Dec 9th, 2008
0

The API

Expand Post »
what is the API
for dispalying an image an image in VB
Similar Threads
Reputation Points: 7
Solved Threads: 0
Newbie Poster
the_swan is offline Offline
21 posts
since Nov 2008
Dec 9th, 2008
0

Re: The API

Not clearly enough...
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
Dec 9th, 2008
0

Re: The API

There's no API calls needed. If you have a picturebox control and an image file, you just do the following:
VB.NET Syntax (Toggle Plain Text)
  1. PictureBox1.Image = Image.FromFile("C:\somepic.jpg")
Of cource, there are other ways to get and display images depending on the source of the image.
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Teme64 is offline Offline
1,024 posts
since Aug 2008
Dec 9th, 2008
0

Re: The API

I save the picture in an array of byte in a file
and the picture was choosen from uploadefile web server control
i want to display the picture a gain on the screen using the repeater . do i need the API to display it
Reputation Points: 7
Solved Threads: 0
Newbie Poster
the_swan is offline Offline
21 posts
since Nov 2008
Dec 10th, 2008
0

Re: The API

Still no API needed.
VB.NET Syntax (Toggle Plain Text)
  1. Imports System.IO
  2.  
  3. Dim MemStream As MemoryStream
  4. Dim ByteArr() As Byte
  5.  
  6. ' Read image bytes from the file
  7. ByteArr = My.Computer.FileSystem.ReadAllBytes("C:\somepic.jpg")
  8. ' Create a memory stream from the bytes
  9. MemStream = New MemoryStream(ByteArr)
  10.  
  11. ' Create an image from the stream
  12. PictureBox1.Image = Image.FromStream(MemStream)
and the picture box is a control in the repeater control.
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Teme64 is offline Offline
1,024 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: HELP! In View menu, Designer is missing!
Next Thread in VB.NET Forum Timeline: VB6 Input and getting Output.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC