473,383 Members | 1,868 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,383 software developers and data experts.

How do I open an Image and load it to a "picturebox" in ASP

Hi,

in Visual Studios there's this tool called PictureBox rite...but in
Visual Web developer i can't seem to find it..

i'm using Visual Web Developer...VB language..to make a watermarking
script so firstly i need to be able to load the picture i want to the
page first..

in VS the code is
Private Sub BrowseToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BrowseToolStripMenuItem.Click

OpenFileDialog1.Title = "Select an image ..."

OpenFileDialog1.Filter = "JPEG files|*.jpg" + "|Enhanced Windows
MetaFile|*.emf" + "|Exchangeable Image File|*.exif" + "|Gif Files|
*.gif|Icons|*.ico|Bitmap Files|*.bmp" + "|PNG Files|*.png|TIFF Files|
*.tif|Windows MetaFile|*.wmf"
OpenFileDialog1.FilterIndex = 1

OpenFileDialog1.FileName = ""

OpenFileDialog1.ShowDialog()

SourceFile = OpenFileDialog1.FileName.ToString()

PictureBox1.Image = Image.FromFile(SourceFile)
SourceFile = Me.OpenFileDialog1.FileName

Watermark.OpenImage(OpenFileDialog1.FileName.ToStr ing)

End Sub

I know OpenFileDialog is used in VS and FileUpload is used in VWD
instead..

So wad so ihave to use in VWD instead of PictureBox?

Basically how do i open the image and load it to a "PictureBox"??

PLZ help..Advance thanks
Jun 27 '08 #1
1 3477
Hello Rishi
So wad so ihave to use in VWD instead of PictureBox?

Basically how do i open the image and load it to a "PictureBox"??
OpenFileDialog doesnt exists in ASP.NET Environment.
User FileUpload instead.

Also a PictureBox isnt available. Use a Image Control or simply an <img....
Tag instead.

There are several differences between an web- or desktopapplication,
be sure to care about these differences to avoid further problems.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Jun 27 '08 #2

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

Similar topics

10
by: gregory_may | last post by:
I have an application I created called "JpegViewer.exe". It simply loads a Jpeg file and displays in on the screen. It works great, in my lab. When I am using it at a customer site, things...
2
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my...
9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
1
by: dawn | last post by:
Hi, I'm writing an app that has two rows of 6 pictureboxes. 1 2 3 4 5 6 7 8 9 10 11 12 When i click on a picturebox in one row.....for example 7....i want the...
6
by: Patrick Dugan | last post by:
Hello, I'm trying to load different images (icons) into a PictureBox1.Image. The first image loads just fine, but the second image always returns the error "Invalid property used." It doesn't...
13
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then...
6
by: Jerry Spence1 | last post by:
I'm going mad here. I know about creating controls at runtime and creating a single event etc. In all the examples I have found they create a button and create an event for it. What I can't fathom...
0
by: Ben3eeE | last post by:
I got one too hard for me to fix problem. I know the cause and i know why but i cant fix it. I am using a "Rubber band" like function, drawing a rectangle on an image in a picturebox that i...
4
by: gerardianlewis | last post by:
Any help appreciated. (VB.NET under XP and Vista, SP1 installed) My code, inherited from a VB6 version of an app that ran under W98, loads an image from a file into a PictureBox. The user may...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.