Archive for February, 2009

Bad/Busy Week

Monday, February 23rd, 2009

fracture x-ray

There is too much to say and I can’t type easily so this is just a list.

  • Last Saturday night: hurt hand
  • Monday: Doctor confirms a “Boxer’s Fracture”
  • Wednesday: Specialist decides to let it heal as is. I get a splint.
  • Thursday: After a wonderful meal at Shaw’s Crab House, I become extremely sick. Maybe it was one of the Oysters.
  • Friday: A professor submits a recommendation for NEIU. The last loose end to so much work is tied up.

 

Accepted

Friday, February 13th, 2009

IIT logo
Yesterday, I received an email informing me I had been admitted as a graduate student at IIT. I couldn’t believe it. After all the problems I had applying, (I still have one application outstanding) I was sure I’d be looking at rejection letters. Having a strong option from the beginning will take all the sting out of any rejection letters I might get.

Resizing JPG’s

Thursday, February 12th, 2009

Don’t forget a streams position

While working on a project that required jpg’s to be resized, I found plenty of examples on the web.
2 Things:

  1. Don’t use System.Drawing.Image.GetThumbnailImage()
  2. With steams, don’t forget to pay special attention to position.
This is a small function for resizing jpg’s

Private Function getResizedImageAsStream(
ByVal xAxis As Integer,
ByVal yAxis As Integer,
ByVal imgOriginal As Drawing.Image)
As System.IO.MemoryStream

Dim bmpTarget As New Bitmap(xAxis, yAxis)
Dim objGraphics As Graphics
= Graphics.FromImage(bmpTarget)
Dim strmImage As New System.IO.MemoryStream
objGraphics.CompositingQuality
= Drawing2D.CompositingQuality.HighSpeed
objGraphics.InterpolationMode
= Drawing2D.InterpolationMode.HighQualityBicubic
objGraphics.CompositingMode
= Drawing2D.CompositingMode.SourceCopy
objGraphics.DrawImage(imgOriginal, 0, 0, xAxis, yAxis)
bmpTarget.Save(strmImage, Drawing.Imaging.ImageFormat.Jpeg)
‘reset stream to beginning
strmImage.Position = 0
Return strmImage
End Function