Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Plug-in for dealing with graphics in VB.net

Posted on 2004-10-17
9
Medium Priority
?
458 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

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!

Question has a verified solution.

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

Make the most of your online learning experience.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Introduction to Processes
Loops Section Overview

916 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