473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SelectActiveFrame bug

It looks like this problem was already posted (in two different newsgroups):

http://groups.google.com/groups?hl=e...mework.drawing
http://groups.google.com/groups?hl=e...oogle%2BSearch

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::Page, 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::Drawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit::Pixel, imageAttrs);

colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::White;
colorMapOverlay[0]->NewColor = Color::Transparent;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(retrievalImage, System::Drawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit::Pixel, 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

Nov 22 '05 #1
3 4244
Hi Christopher,

Thanks for using Microsoft MSDN Managed Newsgroup.

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 22 '05 #2
Hi Christopher,

Thanks for using Microsoft MSDN Managed Newsgroup.

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 22 '05 #3
Hi,

This does look like a bug in GDI+. The problem is with the interaction
between the ImageAttributes and the active frame. It appears that any
changes to the ImageAttributes cause the DrawImage() call to use frame 0.

So, one workaround would be to not use the DrawImage() call which uses
ImageAttributes. Another, as you've noted, would be to extract the frame
into another Bitmap and use that instead.

Please post follow-ups only in microsoft.public.dotnet.framework.drawing,
or microsoft.public.win32.programmer.gdi.

Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.
It looks like this problem was already posted (in two different newsgroups):
http://groups.google.com/groups?hl=e...readm=08f701c3
9712%24d47cf3b0%24a401280a%40phx.gbl&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%2
6ie%3DUTF-8%26oe%3Dutf-8%26q%3Dselectactiveframe%2Bdrawimage%2Bbug%26btnG %3D
Google%2BSearch%26meta%3Dgroup%253Dmicrosoft.publi c.dotnet.framework.drawing http://groups.google.com/groups?hl=e...readm=u9LmR16l
DHA.2772%40TK2MSFTNGP12.phx.gbl&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3Dutf-8%26q%3Dselectactiveframe%2Bdrawimage%2Bbug%26btnG %3DGoogl
e%2BSearch
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::Page, 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::Drawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit::Pixel, imageAttrs);

colorMapOverlay[0] = new ColorMap();
colorMapOverlay[0]->OldColor = Color::White;
colorMapOverlay[0]->NewColor = Color::Transparent;
imageAttrs->SetRemapTable(colorMapOverlay);
g->DrawImage(retrievalImage, System::Drawing::Rectangle(Point::Empty,
retrievalImage->Size), 0, 0, retrievalImage->Width,
retrievalImage->Height, GraphicsUnit::Pixel, 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


Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
2
by: Christopher Bohn | last post by:
It looks like this problem was already posted (in two different newsgroups): ...
0
by: Nicolas Guilhot | last post by:
Hi all ! I have a multi-page Tiff image file that I want to convert to PDF. To do so I am using iText library. The conversion is working, but the code execution is very different according to...
0
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
5
by: David R Emerson | last post by:
I'm working on a document storage / retrieval system in c#. The app stores faxes in TIF format in SQL Server. I'm having a little trouble I hope you folks can help me with: Here's the first...
1
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at...
7
by: Philip Wagenaar | last post by:
I use a class to manage tiff's (written by someone else) to splitt multipage tiffs. However, when I run it, it fails, for other people it seems work ok. The method in the class is :public...
3
by: Gabe | last post by:
Hi all, I was wondering if there is a way that I can set a single frame of a gif file to a picture box programatically? thanks,
3
by: SF | last post by:
Folks, I've been running into problems with a multipage Tif viewer that I wrote to display fax images in an ASP.Net app. I've been basically following the standard examples on how to do this: ...
6
by: Cruithne3753 | last post by:
I'm trying to create a Windows app with a clickable index of images within a local folder. Within a loop I've got:- PictureBox pb = new PictureBox(); pb.Image = Image.FromFile(file); .......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.