Solved

Plug-in for dealing with graphics in VB.net

Posted on 2004-10-17
9
449 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WMI, model #, retrieving information 10 112
Hide vba in gp 7 79
Basic Java Case or If-Else statement... 3 43
Getting the Error "User-defined type not defined" in MS Access 2013 16 36
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

947 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now