CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    12

    Writing JPEGs to printer device

    I'm am trying to write a jpeg image to printer device. I want to read a jpeg into memory and set to a printer device. I am using the Independent JPEG Group's library. I can read a jpg file and write a jpg file but I haven't found any code that shows putting the jpeg on a device. I am wondering if anybody else has accomplished this feat. Or can somebody point me to some useful information on the web or source code. I am having a hell of a time figuring this out.



  2. #2
    Guest

    Re: Writing JPEGs to printer device

    If you can read a JPEG file and convert it to a Device Independent Bitmap (DIB for short), there are various functions that can display the DIB to a device (such as a screen or printer). You need to create a device context (DC) for the device and call StrecthDIBits, or a similar function. You can also take a look at sample programs such as SHOWDIB (or DIBSHOW -- I don't remember the name). These sample programs can be found in the VC++ Samples directory.

    The bottom line is that you're not really manipulating the JPEG image data "as is" when displaying or printing. The first step (which is 95% of the work) is to convert the JPEG, TIFF, PNG, whatever, to a DIB format in memory. Once it's a DIB, there are a lot of code samples out there that show you how to manipulate the DIB.

    Regards,

    Paul McKenzie


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured