what is the API
for dispalying an image an image in VB

Recommended Answers

All 4 Replies

Not clearly enough...

There's no API calls needed. If you have a picturebox control and an image file, you just do the following:

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.

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

Still no API needed.

Imports System.IO

Dim MemStream As MemoryStream
Dim ByteArr() As Byte

' Read image bytes from the file
ByteArr = My.Computer.FileSystem.ReadAllBytes("C:\somepic.jpg")
' Create a memory stream from the bytes
MemStream = New MemoryStream(ByteArr)

' Create an image from the stream
PictureBox1.Image = Image.FromStream(MemStream)

and the picture box is a control in the repeater control.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.