Re: Printing Graphics

new topic     » goto parent     » topic index » view thread      » older message » newer message

rswiston wrote:

>Does anyone have a reliable method of printing bmps or gif from Euphoria 
>through Win32Lib?

First of all, I'm assuming that you don't need to break the image up into 
multiple strips (bands) because of memory constraints. Some versions of 
Windows support this automatically; others don't.

Secondly, I'm assuming you are using BitBlt to print the image. I'm also 
assuming that you are using StretchBlt (or some equivalent) to resize the 
image onto the printer. For example, a 200x200 pixel on a 300 dpi laser 
printer only comes out to 2/3 of a square inch.

Another easy test is to try printing the image pixel by pixel, something 
like:

   for y = 1 to length( image ) do
      scanline = image[i]
      for x = 1 to length( scanline ) do
         -- get a pixel from the image
         color = scanline[x]
         rgb = palette[color]
         -- draw it on the printer
         DrawPixel( Printer, ... )
      end for
   end for

It's likely to take forever this way, but it's one way to test what's going 
on.

Most likely, the problem is that you need to convert the image into a 
dithered image. That is, if the printer only prints black and you send it a 
color or grey image, you only get a black and white image out of it. If it 
doesn't have any pure white spots, that means that all colors get mapped to 
black. Ick.

You can easily test this by trying to print a black and white image.

If that's the case, it's not too hard to write a program that converts a 
color image into a black and white dithered image.

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu