Received: by smtp02.oce.nl (4.1/SMI-4.1)
	id AA18744; Mon, 26 Oct 98 16:31:47 +0100
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by oce.nl (8.9.0/8.9.0) with ESMTP id QAA23166
	for <rvdt@oce.nl>; Mon, 26 Oct 1998 16:22:23 +0100 (MET)
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) 
	by sgi.sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id HAA01044; Mon, 26 Oct 1998 07:20:39 -0800 (PST)
	mail_from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo-owner@localhost)
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	id GAA77820
	for tiff-list;
	Mon, 26 Oct 1998 06:37:23 -0800 (PST)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37])
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	via ESMTP id GAA70584
	for <tiff-relay@cthulhu.engr.sgi.com>;
	Mon, 26 Oct 1998 06:37:22 -0800 (PST)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from cosmo.hitachisoft-co.com (hitachisoft-co.com [38.228.68.10]) 
	by sgi.sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id GAA00484
	for <tiff@sgi.com>; Mon, 26 Oct 1998 06:37:21 -0800 (PST)
	mail_from (gvandegrift@hitachisoft-co.com)
Received: by hitachisoft-co.com with Internet Mail Service (5.5.1960.3)
	id <VVLYWKAC>; Mon, 26 Oct 1998 07:40:01 -0700
Message-Id: <F1154519F71BD2118693004005577BC5064BDA@hitachisoft-co.com>
From: Geoff Vandegrift <gvandegrift@hitachisoft-co.com>
To: Daniel Luna <dlunar@mx3.redestb.es>, tiff@sgi.com
Subject: RE: PRB W95 VC MFC: printing TIFFs using StretchBlt or StretchDIB
	its.
Date: Mon, 26 Oct 1998 07:40:00 -0700
Mime-Version: 1.0
X-Mailer: Internet Mail Service (5.5.1960.3)
Content-Type: text/plain
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk

Printing raster in Windows tends to be problematic.  To find out what
that error code means try the following code (taken from the online
help):

    LPVOID lpMsgBuf;

    FormatMessage( 
        FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
        NULL,
        GetLastError(),
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
        (LPTSTR) &lpMsgBuf,
        0,
        NULL 
    );

    // Display the string.
    MessageBox( NULL, lpMsgBuf, "GetLastError", MB_OK|MB_ICONINFORMATION
);

    // Free the buffer.
    LocalFree( lpMsgBuf );

In my experience, a failed return from any of the Windows BitBlt related
routines is not necessarily a failure.  My habit is to always check
return codes, and I had to remove the code that was checking returns
from my BitBlt calls.  It appeared that everything was going through
okay, and the extended error information was useless.

Have you gotten reasonable output on any other printers?  It is very
possible that the drivers for those printers are not all that they
should be:  we had an HP in our office that couldn't handle masked
blting.

Are you checking to see if the devices really support raster bitblts:

    if (!(dc.GetDeviceCaps(RASTERCAPS) & RC_BITBLT)) {
        // Device doesn't support raster bitblt
    }

I hope this helps a little.  I would be very interested to hear how
things go.

Geoff Vandegrift
Applications Engineer
Hitachi Software Global Technology, Ltd.

> -----Original Message-----
> From:	Daniel Luna [SMTP:dlunar@mx3.redestb.es]
> Sent:	Monday, October 26, 1998 3:27 AM
> To:	ZhunBin
> Subject:	PRB W95 VC MFC: printing TIFFs using StretchBlt or
> StretchDIBits.
> 
> 
> 
> 
> 	Hi there:
> 
> 	I'm in use of Libtiff with Visual C++ 4.0 (with MFC) in WIN95.
> 
> 	I read scanlines from TIFF and then show them using StretchBlt
> or
> StretchDIBits depending on device capabilities.
> 
> 	I show scaled images correctly on display and printers, but in
> some
> printers like HP LaserJet 6P/6MP or Epson Stylus 1500, i get errors on
> printing. 
> 
> 	"Points from my image look compressed and deformed in some
> situations i
> cannot determine".
> 	
> 
> 	StretchDIBits  returns -1. When I use GetLastError, i get an
> error code 6.
> 
> 	
> 	what's my problem?
> 	How can I avoid this effect?
> 
> 
> 	Thanks in advance.
> 
> 		DLR.
> 
> 
> ---------------------------------------
> 
> < dlunar@mx3.redestb.es > 
