Solved

Plug-in for dealing with graphics in VB.net

Posted on 2004-10-17
9
450 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How  do I get an older program to run in Windows 10? 20 110
Hide vba in gp 7 94
VbScript to countdown to New Year's Day 6 54
Delphi: barcode reading on android platform 1 29
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

776 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