C
Christopher Bohn
It looks like this problem was already posted (in two different newsgroups):
http://groups.google.com/groups?hl=...p%3Dmicrosoft.public.dotnet.framework.drawing
http://groups.google.com/groups?hl=...tactiveframe+drawimage+bug&btnG=Google+Search
but neither really had a response that addressed the issue. My company
has also run into this problem. Searching news groups and the web found
very little else on this subject.
Here is an example of the problem:
---------------------------
void Page::LoadImage()
{
int imageHeight = 0;
int imageWidth = 0;
Bitmap* overlayImage;
Bitmap* retrievalImage;
Bitmap* image;
overlayImage = new Bitmap(String::Format("{0}.tiff", pageVariantID));
retrievalImage = new Bitmap(String::Format("image{0}.img",
__box(PageKey)));
// select the correct frame
retrievalImage->SelectActiveFrame(FrameDimension:age, frameNumber);
imageWidth = max(overlayImage->Width, retrievalImage->Width);
imageHeight = max(overlayImage->Height, retrievalImage->Height);
image = new Bitmap(imageWidth, imageHeight,
PixelFormat::Format16bppRgb555);
Graphics* g = Graphics::FromImage(image);
g->Clear(Color::White);
ImageAttributes* imageAttrs = new ImageAttributes();
ColorMap* colorMapOverlay[] = new ColorMap*[1];
colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::Black;
colorMapOverlay[0]->NewColor = Color::Firebrick;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(overlayImage, System:rawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit:ixel, imageAttrs);
colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::White;
colorMapOverlay[0]->NewColor = Color::Transparent;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(retrievalImage, System:rawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit:ixel, imageAttrs);
overlayImage->Dispose();
overlayImage = NULL;
retrievalImage->Dispose();
retrievalImage = NULL;
}
---------------------------
The active frame seems ignored when another image is overlayed. The
older, referenced post gives more details and another example. Is this
a known bug? Is there any work-around (other than extracting each frame
of a multi-image tiff)? Is a fix expected, and if so, in what time frame?
thanks
Chris
http://groups.google.com/groups?hl=...p%3Dmicrosoft.public.dotnet.framework.drawing
http://groups.google.com/groups?hl=...tactiveframe+drawimage+bug&btnG=Google+Search
but neither really had a response that addressed the issue. My company
has also run into this problem. Searching news groups and the web found
very little else on this subject.
Here is an example of the problem:
---------------------------
void Page::LoadImage()
{
int imageHeight = 0;
int imageWidth = 0;
Bitmap* overlayImage;
Bitmap* retrievalImage;
Bitmap* image;
overlayImage = new Bitmap(String::Format("{0}.tiff", pageVariantID));
retrievalImage = new Bitmap(String::Format("image{0}.img",
__box(PageKey)));
// select the correct frame
retrievalImage->SelectActiveFrame(FrameDimension:age, frameNumber);
imageWidth = max(overlayImage->Width, retrievalImage->Width);
imageHeight = max(overlayImage->Height, retrievalImage->Height);
image = new Bitmap(imageWidth, imageHeight,
PixelFormat::Format16bppRgb555);
Graphics* g = Graphics::FromImage(image);
g->Clear(Color::White);
ImageAttributes* imageAttrs = new ImageAttributes();
ColorMap* colorMapOverlay[] = new ColorMap*[1];
colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::Black;
colorMapOverlay[0]->NewColor = Color::Firebrick;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(overlayImage, System:rawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit:ixel, imageAttrs);
colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::White;
colorMapOverlay[0]->NewColor = Color::Transparent;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(retrievalImage, System:rawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit:ixel, imageAttrs);
overlayImage->Dispose();
overlayImage = NULL;
retrievalImage->Dispose();
retrievalImage = NULL;
}
---------------------------
The active frame seems ignored when another image is overlayed. The
older, referenced post gives more details and another example. Is this
a known bug? Is there any work-around (other than extracting each frame
of a multi-image tiff)? Is a fix expected, and if so, in what time frame?
thanks
Chris