Page 1 of 1

Getting Image bytes, I need to send Binary Output to context

PostPosted: Sun Feb 16, 2014 8:53 pm
by zibrohimov
Hi,
I have just started using AForge.net
My first question:

Is it possible to make the following operations on AForge.net without using GDI+? My requirement is "GDI+ less image processing".

1. I want to apply some watermarks to existing image. For example, copyright texts with some rectangular background, probably. This requires me to draw a rectangle with a plain back, then draw a text on that rectangle. All is on existing image.

2. Save you MemoryStream. So far, I've not found an AForge method for saving the images to MemoryStream. But I saw some recommendations about using standard GDI's
Code: Select all
Bitmap.Save()
method. But that is not my case I think.

3. Get Image Bytes. Regularly, what I used to do is Saving the image to MemoryStream and use
Code: Select all
MemoryStream.ToArray()
method to get the image bytes. This allows me to send binary data to
Code: Select all
HttpContext
like this
Code: Select all
context.Response.BinaryWrite(imageBytes).
Can do this operation on AForge without using GDI+ in any way?

Thanks for kind help.