Hi, I am pretty new to ASP.net
I want to do the following but I have been unable to find good info/ or
sample code on it; please help;
- retrieve a gif/jpeg image using ASP.net from another site
- using ASP.net (Visual Basic.net or C#) code I want to edit the image by
superimposing a smaller image on the lower right hand corner
- then display the image to the user
- if possible, store the image to MySQL server
Thank you in advance. and please be as detail as you like.
Joe. 2 1279
Hi,
Maybe you can use this sample that I once made how you can do it. This uses
images in a database, you can as well choise for using paths. Where in my
opinion this one is better for securing your images.
However, when you store your paths in the database, the images can come from
everywhere. (That is a different and easier solution by the way)
\\\For the database the standard Northwind sample database.
\\\It needs 2 forms with a listbox, a picturebox and a label on form1
\\\webform1
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Dim conn As New SqlClient.SqlCo nnection _
("Server=(Local ); DataBase=Northw ind;" & _
"Integrated Security=SSPI")
Dim da As New SqlClient.SqlDa taAdapter _
("SELECT FirstName, EmployeeID FROM Employees", conn)
Dim ds As New DataSet
Me.Image1.Visib le = False
ListBox1.AutoPo stBack = True
Try
da.Fill(ds)
ListBox1.DataSo urce = ds.Tables(0)
ListBox1.DataTe xtField = "FirstName"
ListBox1.DataVa lueField = "EmployeeID "
ListBox1.DataBi nd()
Catch sqlExc As SqlClient.SqlEx ception
Me.Label1.Text = sqlExc.ToString
Catch exc As Exception
Me.Label1.Text = exc.ToString
End Try
End If
End Sub
Private Sub ListBox1_Select edIndexChanged( ByVal sender _
As System.Object, ByVal e As System.EventArg s) _
Handles ListBox1.Select edIndexChanged
Session.Item("i mg") = ListBox1.Select edItem.Value
Image1.Visible = True
Image1.ImageUrl = "http://localhost/TestWebImage/WebForm2.aspx"
'This is the location of the aspx files
End Sub
///
\\\webform2 watch that the Memstream, which is for Northwind
'the normal code is as well in it.
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim conn As New SqlClient.SqlCo nnection("Serve r=(Local);" & _
"DataBase=North wind; Integrated Security=SSPI")
Dim sqlstr As String = _
String.Format(" SELECT Photo FROM Employees WHERE (EmployeeID =
{0})", _
CInt(Session.It em("img")))
Dim cmd As New SqlClient.SqlCo mmand(sqlstr, conn)
conn.Open()
Dim rdr As SqlClient.SqlDa taReader = cmd.ExecuteRead er()
rdr.Read()
Dim arrImage() As Byte = DirectCast(rdr. Item("Photo"), Byte())
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''
'Dim ms1 As New System.IO.Memor yStream(arrImag e)
'The one above is for normal purpose, however Northwint has a
strange format
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''
Dim ms1 As New System.IO.Memor yStream(arrImag e, 78,
arrImage.Length - 78)
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
Dim origimage As System.drawing. Image =
System.Drawing. Image.FromStrea m(ms1)
Dim PThumbnail As System.drawing. Image
PThumbnail = origimage.GetTh umbnailImage(10 0, 100, Nothing, New
IntPtr)
Dim ms2 As New System.IO.Memor yStream
PThumbnail.Save (ms2, Imaging.ImageFo rmat.Bmp)
arrImage = ms2.GetBuffer
Response.Binary Write(arrImage)
rdr.Close()
conn.Close()
End Sub
///
I hope this helps,
Cor
It's easy to retrieve image from other sites and save them on disk.
To manage image and use database, please check out www.aspsimply.com/aspnet/ImageDBASPX.aspx www.aspsimply.com/aspnet/Thumbnail.aspx www.aspsimply.com/vbnet/ImageDB.aspx
Zen
"news.microsoft .com" <jt****@gmail.c om> wrote in message
news:%2******** **********@tk2m sftngp13.phx.gb l... Hi, I am pretty new to ASP.net
I want to do the following but I have been unable to find good info/ or sample code on it; please help;
- retrieve a gif/jpeg image using ASP.net from another site
- using ASP.net (Visual Basic.net or C#) code I want to edit the image by superimposing a smaller image on the lower right hand corner
- then display the image to the user
- if possible, store the image to MySQL server
Thank you in advance. and please be as detail as you like.
Joe. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pierre Tremblay |
last post by:
Hi!
I am trying to display an image in my html document. The document contains
the following line:
<td class="Input"><img
src=getimage.php?tbl=dbo.Employees&type=jpg&col=Photo&idCol=EmployeeID&id=1
Border=0 alt=''> </td>
|
by: news |
last post by:
Hi, I am pretty new to PHP
I want to do the following but I have been unable to find good info/ or
sample code on it; please help;
- retrieve a gif/jpeg image using PHP from another site
- using PHP code I want to edit the image by superimposing a smaller image
on the lower right hand corner
|
by: Matt |
last post by:
In the following code, I have 2 questions regarding submit button with image.
1) Does this code <input type="image" name="populate" src="populate.gif">
behave the same as an HTML submit button with image populate.gif?
When I click p1 or p2 button, it will post the page to process.asp.
2) When I check the checkbox, I want the image in submit button change
from populate.gif to validate.gif. Unfortunately, the code
InputForm.p2.src =...
|
by: news.microsoft.com |
last post by:
Hi, I am pretty new to ASP.net
I want to do the following but I have been unable to find good info/ or
sample code on it; please help;
- retrieve a gif/jpeg image using ASP.net from another site
- using ASP.net (Visual Basic.net or C#) code I want to edit the image by
superimposing a smaller image on the lower right hand corner
|
by: Jake |
last post by:
Does cookieless session state (with the sessionid embedded into the url)
interfere with the browser's retrieval of cached images from one session to
the next? Does the sessionid embedded into the url effectively limit
client-side image caching to the lifetime of the session?
Thanks
Jake
| |
by: BluDog |
last post by:
Hi
I am trying to store an image in an xml file, i vcan store it fine but
the retreval is a bit of a problem:
To String:
Dim ms As New IO.MemoryStream
Dim arrImage() As Byte
Me.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
|
by: addicted2rpg |
last post by:
For background on this problem, see:
http://support.microsoft.com/kb/q249232/
I essentially get a IHTMLWindow2 object, IHTMLDocument2 object, etc..
from an HWND of an internet explorer process. You can think of it as
"hooking", but it probably isn't true hooking since I'm not altering
any normal calls with my own.
Now, I got some image recognition code I want to use with some browser
input. I don't want to use URLDownloadToFile();...
|
by: den 2005 |
last post by:
Hi everyone,
Here is code working on..Trying to insert record with a column with Image
or VarBinary datatype in sql database from a existing jpeg image file, then
retrieve this image from database and display it in a Image web control
dynamically(at runtime).
The process after being displayed in the web control, user click insert/add
button, it converts the image(jpeg) file to bytes and store it the database
with Image or VarBinary...
|
by: Daniel Fetchinson |
last post by:
Hi all,
There are a number of free tools for image matching but it's not very
easy to decipher the actual algorithm from the code that includes db
management, GUI, etc, etc. I have my own image database and GUI so all
I need is the actual algorithm preferably in pseudo code and not in
the form of a research paper (from which I also found a lot but since
I'm not that much interested in the actual science of image
recognition this seems...
|
by: DP |
last post by:
Hi,
I'm not sure if this is the right group to ask. I am developing a
small image library and I don't know how to hide the actual path to
the image. So I go to the stock photo library websites to see how they
hide their images. This is what I see from gettyimages.com
<img src="http://cache2.asset-cache.net/xc/200186170-001.jpg?
v=1&c=NewsMaker&k=2&d=1EF4EE1EFB3A2CD3E55FD7668143826B10621193DB58D674"
id="ctl12_ctlComp_imgThumb"...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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
|
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...
| |