473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 BrowseToolStrip MenuItem_Click( ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
BrowseToolStrip MenuItem.Click

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

OpenFileDialog1 .Filter = "JPEG files|*.jpg" + "|Enhanced Windows
MetaFile|*.emf" + "|Exchangea ble Image File|*.exif" + "|Gif Files|
*.gif|Icons|*.i co|Bitmap Files|*.bmp" + "|PNG Files|*.png|TIF F Files|
*.tif|Windows MetaFile|*.wmf"
OpenFileDialog1 .FilterIndex = 1

OpenFileDialog1 .FileName = ""

OpenFileDialog1 .ShowDialog()

SourceFile = OpenFileDialog1 .FileName.ToStr ing()

PictureBox1.Ima ge = Image.FromFile( SourceFile)
SourceFile = Me.OpenFileDial og1.FileName

Watermark.OpenI mage(OpenFileDi alog1.FileName. ToString)

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 3515
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 desktopapplicat ion,
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
4836
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 change. Occasionally, it blows up with an Application Exception. It seems to only die at the customer site
2
12396
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 code in the "real" project. In the "real" project, One part of the program saves multiple images and another part of the program moves the images to the appropriate directories based on user feedback.
9
1966
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 Basic .Net application. I have researched MSDN for help and found the example article 321900 (see below) and set up a test and everything works fine when I use SQL Server 2000 but when I modify the code and use data from Access 2000 using an...
1
2035
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 picture in it to move to the first free picturebox in the other row. So if 1
6
2141
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 matter what icons are loaded. The first always shows up and any icons after that give me the error. Here is the offending code: The "DestinationPath" variable is the full path and filename of the icon
13
4650
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 open that file in whatever viewer/editor is the default for the users system. I tried to do picturebox1.image.save(filename), which results in "A Generic error occured in GDI+". However, if I use an unbound picturebox, do a
6
1399
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 out is how to refer to a non-event control such as a picturebox. I have created them as follows: For n As Integer = 1 To 10 Dim c As New PictureBox With c
0
1548
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 loaded. Now i want to Cut out the part i marked with the "Rubber band" and load that image in the picturebox. This works great and i can save that image as i want to. The problem is that the image loaded is smaller cause when i load the image i use...
4
5574
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 want to move or delete the file that is being shown. The corresponding event- driven code for "delete this picture" uses: My.Computer.FileSystem.DeleteFile(sPath)
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8743
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
8522
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
8622
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...
1
6177
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
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2745
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
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
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.