Hi! Glad to see things are moving along nicely for Aurigma.
We bought and used V2 of the graphics mill last year for a project which was a great success. We are now updating and enhancing that project and want to use V3 of the GM. With that in mind, I'm looking for information about what that entails. What is the upgrade process? What chances have been made in V3? Are there any issues that I should be aware of?
I appologize if this information is already available somewhere, I looked around your site, but couldn't find it.
In fact the Graphics Mill for .NET has completely different API comparing to the ActiveX version. So to migrate you need to rewrite the code which uses Graphics Mill from a scratch.
A bad news is that we did not port the ProjectivePoints/ProjectiveMatrix transform yet (as far as I remember it is quite essential transform in your project). But we will likely include it into some of the nearest update.
Looks like I will be abandoning my upgrade saga afterall.
We have an addiontional constraint in that our client doesn't like to install COM components on their server and would prefer a solution (like .net) that doesn't require them to install anything beyound the files in the web folder.
Do you have any suggestions for a solution or possible workaround? Why wasn't the projective functionality upgraded? Some sort of technical difficulty with .NET?
In fact we did not include it because we were out of schedule with .NET version release, so we decided to release the first version without this feature. There was not any specific technical problem with it, we just had to freeze the features list, otherwise we would work at it forever...
However since this feature is urgent to you, I will discuss it with developers. How urgent is it (you may email to sales@aurigma.com)?
using( MemoryStream ms = new MemoryStream())
{
Scene.Render(filenameBackground, filenameMask, arrParams, xmlFilename, _product).Save(ms, new Aurigma.GraphicsMill.Codecs.BmpEncoderOptions() );
return ms.GetBuffer();
}
I would recommend to avoid using returned bitmap implicitly. The problem is that the memory for .NET objects is released by garbage collector not immediately when you leave the variable scope. This way if a lot of users run this code, it will be looking like a memory leak (which will be freed in some time, but you will have a peak of memory usage).
That's why I would improve this code in the following way:
using( MemoryStream ms = new MemoryStream())
{
Aurigma.GraphicsMill.Bitmap bmp = Scene.Render(filenameBackground, filenameMask, arrParams, xmlFilename, _product);
bmp.Save(ms, new Aurigma.GraphicsMill.Codecs.BmpEncoderOptions());
bmp.Dispose();
return ms.GetBuffer();
}
> gmMask.LoadFromFile( filenameMask ); // must be 8bpp grayscale <---is this still true?
If you are working with 8 bits per channel bitmaps (like 24-bit RGB, etc), the mask should be 8bppGrayscale. If you are working with extended pixels (16 bits per channel, like 48-bit RGB, etc), you should use 16bpp grayscale.
I believe that you are always use 8-bit images.
> gmFloor.Channels.Replace( gmMask, 3 ); <--- there is no more replace method
As you noticed in the next post - you should use an indexer:
bmp.Channels[3] = mask; // = bmp.Channels.Replace(mask, 3) in GM 2.0
mask = bmp.Channels[3]; // = bmp.Channels.Extract(3) in GM 2.0
Thanks for the pointers Andrew. I will have a look at the web control, it may be a fit.
It turns out that I was using that code for saving (or close to it):
// return the image as a byte array
using( MemoryStream ms = new MemoryStream())
{
using(Aurigma.GraphicsMill.Bitmap b = Scene.Render(filenameBackground, filenameMask, xmlParams, xmlFilename, _product))
b.Save(ms, new BmpEncoderOptions() );
return ms.GetBuffer();
}
I'm having trouble getting a mask working. Under 2.0 I was using the following method (updated to v3, but doesnt give the desired result):
// create/add the mask for the floor
if( ! gmFloorResized.HasAlpha )
gmFloorResized.Channels.AddAlpha(0);
gmFloorResized.Channels[3] = gmMask;
gmFloorResized.Draw(gmBack, 0, 0, gmFloor.Width, gmFloor.Height, 0, 0, gmFloor.Width, gmFloor.Height, CombineMode.Alpha,0, InterpolationMode.HighSpeed);
Is there a new/better way of accomplishing this? I see in the help that there is a MaskedBitTransform.ApplyMaskTransform method, but I don't see how to use to accomplish what I want.
We are considering adding code samples into the class reference. Meanwhile you could examine the section called "Programming with Graphics Mill". It contains a number of different code samples which will could be useful for you and give you more ideas how to use Graphics Mill features.