Solved

Plug-in for dealing with graphics in VB.net

Posted on 2004-10-17
9
455 Views
Last Modified: 2011-09-20
I am a VB.net programmer.  I am writing an app that needs to resize pics, resample resolution, maybe adjust brightness / contrast and convert to and from different picture formats.  I hate dealing with the code to deal with pictures and graphics, it is confusing.  I was wondering if anyone knew of a plug-in that does this kind of image work automatically?

Thanks so much.
0
Comment
Question by:hunterdnance
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
9 Comments
 
LVL 1

Expert Comment

by:liads
ID: 12334207
You're in great luck! The .NET framework has got a built-in graphics handling library.
Check the System.Drawing namespace.
I've come across this code a while ago, but haven't got the time to test it yet.
Anyway, the following example should return a resized image.

<%@ Page Language="vb" Debug="True" %>
<%@ import namespace="System" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Drawing.Imaging" %>
<%@ import namespace="System.IO" %>
<script runat="server">

Sub CreateThumb()

  dim graphic as System.Drawing.Image = System.Drawing.Image.FromFile(request("Image"))
  dim graphicFormat = graphic.rawformat
  dim Image as New Bitmap(graphic, cint(request("Width")), cint(request("Height")))

  if graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif) then
    Response.ContentType = "image/gif"
  elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg) then
    Response.ContentType = "image/jpeg"
  elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Png) then
    Response.ContentType = "image/png"
  elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Bmp) then
    Response.ContentType = "image/bmp"
  end if

  Image.Save(Response.OutputStream, graphicFormat)

  graphic.Dispose()
  Image.Dispose()

End Sub
</script>

<% CreateThumb() %>
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12334211
GDI+ is already in .net and can already do everything you need.

Its in the drawing package of .net look in the MS API for information and code samples.


>> I hate dealing with the code to deal with pictures

Just read that bit. There's a fair bit of coding :\
0
 

Author Comment

by:hunterdnance
ID: 12334472
Ok the code you guys have posted is what I am trying to avoid.  My question; is there a plug-in (like a toolbox control) that does this.  For instance:

plugin1.image.resize.percent(50)
plugin1.image.format.convertTo(bitmap)
plugin1.image.colors.depth(grayscale)


See how simple?  May be a fantasy of mine, but if you want the points give me a simple yes or no if a plugin control like that exsists.

Thanks and sorry for the trouble.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:liads
ID: 12334504
I was looking for a COM component to do so for my asp pages.
I found several, but all of them required payment, and some are really not cheap.

I can post the list from my bookmarks, if you're still interested in them.
0
 

Author Comment

by:hunterdnance
ID: 12334554
I have a $3,000 expense budget for this prototype.....Money is of no object, haha.

I am awarding you the points, please list the bookmarks and your suggestion on which one is best.

Thanks.
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12334569
dude, dont allocate points for non-answers


even if money IS no object, writing something a) doesnt take that long and b) will probably be better optimised for what you want...

It doesnt often make a lot of sense to just throw money at a problem.
0
 
LVL 1

Accepted Solution

by:
liads earned 500 total points
ID: 12334608
Thanks !

I'm giving you the links to a directory full of these components. And hey, it seems there're ASP.NET controls there as well :)

For ASP components:
http://www.aspin.com/home/components/graphics

For ASP.NET controls:
http://www.411asp.net/home/assembly/graphics

Check out their 'related categories'. There are more relevant categories there.

From my searches, I was most impressed with AspJpeg (http://www.aspjpeg.com).
Not because I could actually use it, but because it's the most popular among asp programmers for such tasks. (and seems easy enough to use)

Enjoy :)
0
 

Author Comment

by:hunterdnance
ID: 12334918
Admin:  Won't happen again, sorry for the inconvience. -Hunter
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question