Picture box control
Picture box control
Picture box control
Picture box control
Picture box control
Picture box control Picture box control Picture box control Picture box control Picture box control Picture box control Picture box control Picture box control
Picture box control Picture box control
Picture box control
Go Back  Xtreme Visual Basic Talk > > > Picture box control


Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2006, 06:32 PM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default Picture box control


Ok....I am totally new to ASP. What do they do to display a picture? I dont see a picture box control. I tried the Image control...no luck. Can I somehow display a local pic? Sorry for the dumb qusetion. Wont be the first.
Reply With Quote
  #2  
Old 12-18-2006, 06:50 PM
Volte's Avatar
VoltePicture box control Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

Use the HTML <img> tag.

edit: corrected a monumental blunder

Last edited by Volte; 12-18-2006 at 07:00 PM.
Reply With Quote
  #3  
Old 12-18-2006, 11:53 PM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default

Quote:
Originally Posted by Volte View Post
Use the HTML <img> tag.

edit: corrected a monumental blunder
Ah,,,my ASP book says nothing about images. Why does this work on some pics, and others not:

Image1.ImageURL " "StringLocation"

I must be missing something.do I put the pat of my image in the <>? For some reason I get "HTML is not defined".

Last edited by bonedoc; 12-19-2006 at 07:19 AM.
Reply With Quote
  #4  
Old 12-19-2006, 07:28 AM
wayneph's Avatar
waynephPicture box control wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

If you're using the Image1.... syntax you need to have runat="server" specifed in your tag. Either <img runat="server" id="Image1" /> or <asp:Image runat="server" ... />

And then it has to be a valid http location of the file. To get paths relative to the application root you can start the path with a tilde. (~)
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 12-19-2006, 07:41 AM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default

You know, I must be doing something wrong. I created an ASP application, and I am typing this code in the Default.aspx.vb window. Does HTML code go in another window? Is it not accepting the code because I have not imported some namespace? It does not recognize IMG or SRC or anything. I am sure it is somthing stupid.
Reply With Quote
  #6  
Old 12-19-2006, 07:50 AM
wayneph's Avatar
waynephPicture box control wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

your HTML code goes in the Default.aspx page. Only the VB code behind goes in the .vb files.

Please don't take this the wrong way, but I'd go through a couple tutorials and "Hello World" type programs to get the hang of asp.net. Contrary to popular belief just because you can do windows forms, doesn't mean you're ready for web forms.

It's a whole new architecture.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #7  
Old 12-19-2006, 08:15 AM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default

I wondered about that. I am curious, How can I link the 2? If I am getting data in my vb form as to a picture location and the picture changes, how does that go over and tell the HTML code to change pictures? What is also weird is that this shows a picture fine:

Image1.ImageURL = "C:\Pic1.jpg"

But this wont show my pic:

Image1.ImageURL = "C:\Pic2.jpg"

They are both valid jpgs. One wont display and one will. The path is correct too. I bought an ASP book from microsoft...and it sucks! i will look around for a tutorial.
Reply With Quote
  #8  
Old 12-19-2006, 08:26 AM
wayneph's Avatar
waynephPicture box control wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

acutally as far as web sites go... neither one is a valid URL. If it's really on the C: drive (and it shouldn't be) you should use file://c:/pic1.jpg.

They should be included in your web application in a photos directory or something similar. Then the path would be '~/photos/pic1.jpg'. If you use c: in your path, you will have to distribute all of the images to each user individually, and make sure they are in the same place on every machine. It defeats the purpose of making it a web site.

Which book did you get? Is it classic ASP or ASP.NET? They are totally different things. What version of .NET are you using 1.1 or 2.0?
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #9  
Old 12-19-2006, 08:43 AM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default

hmm...I must have the wrong idea. Basically, I have a program that does a slide show of someones personal pictures. It is in vb .net 2005. My book is actually ASP .NET.

So, I wet to "New/WebPage" when I opened 2005. Basically, I wanted someone to be able to go on the web to my computers IP address on port X and access their pictures. My situation is unique, because nobody can access their pictures but them, and there is a personal code for thei file info. My code works great, but the image for some reason is not being displayed.

I figured I could have someone at home open my IP address and see their personal pics. It is nothing high traffic or anything. What do you think?
Reply With Quote
  #10  
Old 12-19-2006, 08:48 AM
wayneph's Avatar
waynephPicture box control wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Quote:
Originally Posted by bonedoc View Post
I figured I could have someone at home open my IP address and see their personal pics. It is nothing high traffic or anything. What do you think?
I'd use one of the programs I have installed on my computer to view local images. Going to an external site to view local images makes no sense to me.

Again, every user would have to have the exact same image names in the exact same place. There would be no way to customize it. your ASP.NET vb code runs on the server, so it has no access to the users machine. And if the users security is configured correctly, any JavaScript you try to put in the client side code, would be denied access to the hard drive as well.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #11  
Old 12-19-2006, 09:02 AM
bonedoc bonedoc is offline
Junior Contributor
 
Join Date: Mar 2006
Posts: 376
Default

I see. So, with my current app, I would have to upload every image to my server. That seems like a ton of work! I have an app on my mac that allows my computer function as a server. I set my computer to act as a server and you can access it cameras from the net. Because the use of this ap I want to create is very small, is there a way to make my computer a server?
Reply With Quote
  #12  
Old 12-19-2006, 12:24 PM
wayneph's Avatar
waynephPicture box control wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Web apps are bad for distributed data. Since each user has their own data source a web app doesn't make sense. But since each person is only going to use their own images, it really doesn't make sense to have everyone send you their images either.

A Windows App really would be more useful in this scenario.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #13  
Old 12-19-2006, 02:22 PM
MikeJ's Avatar
MikeJPicture box control MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

* Mike slips in and adds:
It's really file:///...

(But that's besides the point!)
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Picture box control
Picture box control
Picture box control Picture box control
Picture box control
Picture box control
Picture box control Picture box control Picture box control Picture box control Picture box control Picture box control Picture box control
Picture box control
Picture box control
 
Picture box control
Picture box control
 
-->