VB.NET Picturebox Blurring Smaller Images

Hi Experts,

I'm developing a graphical processing package in (possibly the worst language for this!!) VB.NET, and part of this involves me showing a small 10x10 or 50x50 pixel image in a large picturebox. The VB.NET control is blurring the image, making it impossible to distinguish between the pixels. The picturebox is on 'Stretch' mode, in order to bring the pixels to a viewable level.

If any experts know how to either change the properties of the picture box, or how to scale up the image without using get/setpixel as this is too slow for my application then i would be most appreciative.

Tom
daveford123Asked:
Who is Participating?
 
rachitkohliConnect With a Mentor Commented:
You may try picturebox property SizeMode=Zoom
Since this will fit in the picture box, but will also mantain the aspect ratio of the image.
To resize the image, dont use Get/Set pixels, you may use the graphics object DrawImage method.
But if you use DrawImage method, you need to set the width, height manually (if required need to also keep in mind about the aspect ratio, since its a very important factor while resizing an image)

Just a note, vb.net is not a worst language for Graphical Processing any more, since it has a powerful GDI+ class library, which can do anything.
I have managed to make a full fledged photo editing software with multi-layer it.

0
 
rachitkohliCommented:
a nice site to understand the fundamentals about gdi+

http://bobpowell.net/
0
 
daveford123Author Commented:
Rachitkohli, That site is just what im looking for, with the translation matrix(es). the only issue im having now is changing the graphics object into the image data type that the picturebox can display. Any ideas?
0
 
daveford123Author Commented:
Thought this might help; this is the code im using currently, and getting a 'generic error'. Previously i was using the commented code and getting a 'type mismatch' error.
        Dim e As Graphics
        e = Graphics.FromImage(TempImg)
        e.Transform = New Drawing2D.Matrix(50, 0, 0, 50, 0, 0)
        COMP_TRANS.Image = e
        COMP_TRANS.Image = Image.FromHbitmap(e.GetHdc)

Open in new window

0
 
daveford123Author Commented:
Cheers for that - good site, good advice
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.