please help with printing mappings 
Author Message
 please help with printing mappings

I have this problem: In OnDraw I do this:

pDC->SetMapMode (MM_LOENGLISH);

and then I draw a grid of pixels, one each 2 pixels. The grid is not
homogen - it's like 10 pixels ok, then 2 black pixels together, then 10 ok,
2 together, and so forth.

I need a way to set some pixels and lines to pDC and then print that to
printer in 1:1 fashion. Is there an easy-to-implement way to do it? (if it
was easy I would do it myself, so I say -to-implement :)) ) I've tried to
put small rectangles, but when they resize to printers DC they go nuts, some
larger, some smaller, some not visible at all...

The program is supposed to draw and print a function graph.

greetings from Belgrade,
Nikola



Wed, 03 Jul 2002 03:00:00 GMT  
 please help with printing mappings
What you have is a classic problem in aliasing of bitmaps when
scaling. Some lines will be 5 pixels wide when drawn on the printer,
some will be 6 pixels wide, some will be 7 pixels wide. These
differences are often quite visible. Why? Essentially, it is roundoff
error. There are no half-pixels. Generally, the transformation is any
partial pixel is drawn, e.g., if you had (I'll use xs to indicate
black pixels and 3 os to index white pixels
        oooooooxxoooooooo
in your logical drawing, it might turn into
        oooooooooooooooooooxxxxooooooooooooooooo
when mapped, but then again it might turn into
        oooooooooooooooooooxxxx>oooooooooooooooo
where the > is "half an x", and a half pixel, so it is drawn as
        oooooooooooooooooooxxxxxoooooooooooooooo
or it could be
        oooooooooooooooooo<xxxxooooooooooooooooo
and be drawn as
        ooooooooooooooooooxxxxxooooooooooooooooo
or even
        oooooooooooooooooo<xxxx>oooooooooooooooo
and be drawn as
        ooooooooooooooooooxxxxxxoooooooooooooooo
all of which look different on the printer. The problems of this
aliasing are what make font renderers like Adobe Type 1 fonts and
TrueType fonts interesting chunks of code.

postscript has a primitive for doing rendering properly (although I've
forgotten its name) but I don't know of an equivalent one in Windows
for handling pixel aliasing of this nature.
                                joe

Unfortunately, there is no easy way to get around this.
On Sat, 15 Jan 2000 10:57:52 +0100, "nikola cosic (nee)"

Quote:

>I have this problem: In OnDraw I do this:

>pDC->SetMapMode (MM_LOENGLISH);

>and then I draw a grid of pixels, one each 2 pixels. The grid is not
>homogen - it's like 10 pixels ok, then 2 black pixels together, then 10 ok,
>2 together, and so forth.

>I need a way to set some pixels and lines to pDC and then print that to
>printer in 1:1 fashion. Is there an easy-to-implement way to do it? (if it
>was easy I would do it myself, so I say -to-implement :)) ) I've tried to
>put small rectangles, but when they resize to printers DC they go nuts, some
>larger, some smaller, some not visible at all...

>The program is supposed to draw and print a function graph.

>greetings from Belgrade,
>Nikola

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Wed, 03 Jul 2002 03:00:00 GMT  
 please help with printing mappings
So, do you think that drawing programs like paint or photoshop have their
own functions to communicate with the printer? Since paint is a Microsoft
product delivered with windows, it seems rather strange that it would have
something from Windows redone from scratch. And yet, it prints pictures 1:1
with no visible deformations. How come?

greetings from Belgrade,
Nikola



Quote:
> What you have is a classic problem in aliasing of bitmaps when
> scaling. Some lines will be 5 pixels wide when drawn on the printer,
> some will be 6 pixels wide, some will be 7 pixels wide. These
> differences are often quite visible. Why? Essentially, it is roundoff
> error. There are no half-pixels. Generally, the transformation is any
> partial pixel is drawn, e.g., if you had (I'll use xs to indicate
> black pixels and 3 os to index white pixels
> oooooooxxoooooooo
> in your logical drawing, it might turn into
> oooooooooooooooooooxxxxooooooooooooooooo
> when mapped, but then again it might turn into
> oooooooooooooooooooxxxx>oooooooooooooooo
> where the > is "half an x", and a half pixel, so it is drawn as
> oooooooooooooooooooxxxxxoooooooooooooooo
> or it could be
> oooooooooooooooooo<xxxxooooooooooooooooo
> and be drawn as
> ooooooooooooooooooxxxxxooooooooooooooooo
> or even
> oooooooooooooooooo<xxxx>oooooooooooooooo
> and be drawn as
> ooooooooooooooooooxxxxxxoooooooooooooooo
> all of which look different on the printer. The problems of this
> aliasing are what make font renderers like Adobe Type 1 fonts and
> TrueType fonts interesting chunks of code.

> PostScript has a primitive for doing rendering properly (although I've
> forgotten its name) but I don't know of an equivalent one in Windows
> for handling pixel aliasing of this nature.
> joe

> Unfortunately, there is no easy way to get around this.
> On Sat, 15 Jan 2000 10:57:52 +0100, "nikola cosic (nee)"

> >I have this problem: In OnDraw I do this:

> >pDC->SetMapMode (MM_LOENGLISH);

> >and then I draw a grid of pixels, one each 2 pixels. The grid is not
> >homogen - it's like 10 pixels ok, then 2 black pixels together, then 10
ok,
> >2 together, and so forth.

> >I need a way to set some pixels and lines to pDC and then print that to
> >printer in 1:1 fashion. Is there an easy-to-implement way to do it? (if
it
> >was easy I would do it myself, so I say -to-implement :)) ) I've tried to
> >put small rectangles, but when they resize to printers DC they go nuts,
some
> >larger, some smaller, some not visible at all...

> >The program is supposed to draw and print a function graph.

> >greetings from Belgrade,
> >Nikola

> Joseph M. Newcomer [MVP]

> Web: http://www3.pgh.net/~newcomer
> MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm



Thu, 04 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

2. DllInclude mapping for WinSCard.dll...please help

3. Please help!!!!Please help!!!!Please help!!!!

4. print help, please help me!

5. Print help, please help me

6. Problems printing with MM_LOMETRIC mapping mode

7. Printing and mapping mode

8. Printing: mapping meaningful values to logical units???

9. GDI+ : printing a bitmap, please help me out

10. Printing problem ! Please Help

11. Help Please : Weird things happening with printing text in graphics mode using Turbo C++

12. Printing Help please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 
Powered by phpBB® Forum Software