Link to home
Start Free TrialLog in
Avatar of lyka090898
lyka090898

asked on

Problem with API FloodFill

I am currently developing a graphic editor which will open and save files in WMF format.  I'm using API function calls to draw GDI objects to WMF format but I am having trouble with FloodFill.  According to my references, each metafile records contain a function with a specified Function Number and the FloodFill's function number is &H419.  All of the API calls I used produced their expected function numbers except for one, the FloodFill for it returned an UNKNOWN FUNCTION with a function number &H548(when I used the ListWMF software to view the metafile records).  What's so funny about it is that you can display the metafile correctly when you play it on screen, but when you play the metafile to the printer, the FloodFill doesn't work.  I have received suggestions to first turn the WMF to bitmap before printing but I don't want this for it causes pixelation.

Can anyone help me find a FloodFill function which will produce the correct Function Number?
Avatar of Mirkwood
Mirkwood

&h419 = META_FLOODFILL
&H548 = META_EXTFLOODFILL
ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lyka090898

ASKER

Mirkwood,

Thanks for bringing out the GetDeviceCaps function to my attention.  I tried to use it and I found out that the function is not supported by my printer.  Now that I know that my printer doesn't support FloodFill, does this mean that it also doesn't support ExtFloodFill in case I try to use EMF instead of WMF?  And in case I really have to convert to EMF, can you refer some websites where I can get some information regarding the internal structure and format of EMF.  I don't have an idea regarding loading (plus enumerating EMF metarecords) and saving EMF files.

I'm NOT rejecting your answer.  I just need to get more information.  Thanks again for the immediate reply.
First try to see if it is EMF compliant: DC_EMF_COMPLIANT
Yes, Ext floodfill will not be supported
Try this site
http://www.ora.com/centers/gff/formats/micmeta/index.htm
or Altavista
http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=%2Bemr+%2Bmetafile+-abbreviation+-acronym+-acronyms+-glossary



Mirkwood,

Again I would have to get more info.  First should I use DC_EMF_COMPLIANT with GetDeviceCaps just like how I used it with RC_FLOODFILL?  Second, since you asnwered that my PRINTER will not be able to support ExtFloodFill, then WHAT FIUNCTION CAN I USE TO BE ABLE TO PERFORM FLOODFILL (that can be included as a metafile record for both WMF and EMF) that my printer will be able to support?  Since ExtFloodFill will also not be supported by my printer then maybe it would be useless to convert my WMF files to EMF.  Actually, I was able to device my own FloodFill by using a set polylines but when I tried to play the metafile using a smaller window extension, I can view some gaps or unfilled areas which should have been filled, especially if its bounding object has arcs.

By the way, thanks for the websites you mentioned.