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

Image attributes

I have a page that can upload or display a particular image from a SQL
server....works fine. Data is stored as a binary data type.

I'm looking for a simple way to find out what some of the attributes of the
image are, such has the size, x & y dimensions.

Thanks. -Rob T.
Nov 18 '05 #1
3 1139
You would probably want to load the image into a System.Drawing.Image, and
get these attributes from the properties of the instance.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
I have a page that can upload or display a particular image from a SQL
server....works fine. Data is stored as a binary data type.

I'm looking for a simple way to find out what some of the attributes of the image are, such has the size, x & y dimensions.

Thanks. -Rob T.

Nov 18 '05 #2
Thanks. I'm not too familiar with playing around with images..is there some
place you can point me to on loading SQL images into a bitmap? Thanks.

PS.
The current code I use to display an image is something like this...

Dim cnnCUS As SqlConnection 'connection to the CUS DB
Dim strSQL As String 'text SQL statement
Dim cmdSQL As SqlCommand 'SQL command
Dim dtrRS As SqlDataReader 'Data reader (record set)

cnnCUS = New SqlConnection(Session("cnnCUS"))

strSQL = "select Img, ImgType from FormImg where ImgID='" &
Request("ImgID") & "'"
cmdSQL = New SqlCommand(strSQL, cnnCUS)
cnnCUS.Open()
dtrRS = cmdSQL.ExecuteReader
If dtrRS.Read = True Then
Response.ContentType = dtrRS.Item("ImgType")
Response.BinaryWrite(dtrRS.Item("Img"))
End If
dtrRS.Close()
cnnCUS.Close()

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:u7**************@tk2msftngp13.phx.gbl...
You would probably want to load the image into a System.Drawing.Image, and
get these attributes from the properties of the instance.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
I have a page that can upload or display a particular image from a SQL
server....works fine. Data is stored as a binary data type.

I'm looking for a simple way to find out what some of the attributes of

the
image are, such has the size, x & y dimensions.

Thanks. -Rob T.


Nov 18 '05 #3
Hi Rob,

I personally have never done this. However, the freely downloadable .Net SDK
should have all the information you need to figure out how:

http://www.microsoft.com/downloads/d...displaylang=en

I read it every day. :-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:ON*************@TK2MSFTNGP09.phx.gbl...
Thanks. I'm not too familiar with playing around with images..is there some place you can point me to on loading SQL images into a bitmap? Thanks.

PS.
The current code I use to display an image is something like this...

Dim cnnCUS As SqlConnection 'connection to the CUS DB
Dim strSQL As String 'text SQL statement
Dim cmdSQL As SqlCommand 'SQL command
Dim dtrRS As SqlDataReader 'Data reader (record set)

cnnCUS = New SqlConnection(Session("cnnCUS"))

strSQL = "select Img, ImgType from FormImg where ImgID='" &
Request("ImgID") & "'"
cmdSQL = New SqlCommand(strSQL, cnnCUS)
cnnCUS.Open()
dtrRS = cmdSQL.ExecuteReader
If dtrRS.Read = True Then
Response.ContentType = dtrRS.Item("ImgType")
Response.BinaryWrite(dtrRS.Item("Img"))
End If
dtrRS.Close()
cnnCUS.Close()

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:u7**************@tk2msftngp13.phx.gbl...
You would probably want to load the image into a System.Drawing.Image, and get these attributes from the properties of the instance.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
I have a page that can upload or display a particular image from a SQL
server....works fine. Data is stored as a binary data type.

I'm looking for a simple way to find out what some of the attributes
of the
image are, such has the size, x & y dimensions.

Thanks. -Rob T.



Nov 18 '05 #4

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

Similar topics

5
by: Csaba Gabor | last post by:
Is there any way to determine the pixel height and width of an original image? Specifically, If I have <IMG id=myImg src="pic.jpg" height=200 width=300> can I figure out what the original size...
1
by: Blake Versiga | last post by:
After pulling an image from the data base and the Image.Height and Image.Width are not set to the ImageURL's attributes. 1) Is there a way to have these properties updated? or 2) How do I get...
2
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
3
by: Craig Cockburn | last post by:
Hi I have a background image on this page http://www.siliconglen.com/craig/ which is no longer appearing, yet the image is there. could someone let me know why it isn't appearing? I assume...
8
by: Nathan Sokalski | last post by:
I have several System.Web.UI.WebControls.HyperLink Controls which I want to display as rollover images. I know how to make these manually using the <a> and <img> tags or the <a> tag and a...
0
by: Dionysusmtl | last post by:
I'm working on a flash portfolio that loads examples of our work (jpgs) into a movie. For example, it started off using an xml list to display certain images but I found it necessary to draw info...
0
by: numbnutz | last post by:
Hi, I am currently working on an XML Gallery for my girlfriend's brother who is a photographer. I have created a flash front end template and am using an XML database to load the images and...
1
by: creative1 | last post by:
I have designed a gallery using XML FILE. File uploads the thumbnails and displays the big image on click of the image. I wan to open a site on click of the bigger image. Can someone help me how I...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.