A Computer hardware and components forum. ComputerBanter.com

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ComputerBanter.com forum » General Hardware & Peripherals » Printers
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

Problem while performing StretchBlt on HP 1010, HP 1018, HP 1020 andHP 3050

Thread Tools Display Modes
Old May 6th 08, 05:00 PM posted to comp.periphs.printers
external usenet poster
Posts: 1
Default Problem while performing StretchBlt on HP 1010, HP 1018, HP 1020 andHP 3050

Our application uses Windows GDI library to perform rendering and
display of data/output onto
the devices such as Screen and Printer.

While I am trying to print the data onto a series of printers (HP
1010, HP 1018, HP 1020 and HP
3050) I am facing a typical problem.


1. Appropriate DC for the intended device is created [Printer DC
created for a selected printer in this case]
2. The data is displayed onto the identified position onto the DC

The details of data (fields) to be displayed and their position onto
the DC is calculated before the printing begins.

If sufficient space is available for displaying/printing a field
(data), then it is displayed directly onto the DC (using TextOut.

However at situations, the space available for printing (displaying) a
piece of data may not be enough. In such scenario, I display such
information onto a temperory (display) DC and then perform
StretchBlt(....) onto the printer DC.

StretchBlt is capable of performing both Stretch / shrink from source
DC to the destination DC.

[MSDN: The StretchBlt function copies a bitmap from a source rectangle
into a destination rectangle, stretching or compressing the bitmap to
fit the dimensions of the destination rectangle, if necessary. The
system stretches or compresses (shrinks) the bitmap according to the
stretching mode currently set in the destination device context].

In this case:
- Data is first displayed / outputted onto tempDC
- Then StretchBlt is performed from tempDC to PrinterDC

The rectangular area on the destination DC is more than source
rectangular area then data is stretched
If the rectangular area on the destination DC is less than source
rectangular area then data is shrinked

StretchBlt(...) allows us to specify the raster operation to use while
performing this task as its last parameter.

Here I am using SRCAND. When I use SRCAND raster operation the data is
displayed in actual font size instead of shrinking. This results on
loss of data (as sufficient width/height) is not available to
displayed data

The same operation works on several other DeskJet/LaserJet (including
HP) printers. But it fails on the above mentioned set of printers.

If I try to use other raster operation such as SRCCOPY, it is able to
shrink the data and display properly. I can't use other operations. I
have to use SRCAND (as I would like to retain any data that is already
displayed within the rectangular area).

I also observed that, if the destination rectangular area is more than
source rectangular area: then it is able to stretch and display the
data without any loss (even with SRCAND raster operation)

Please let me know, if any of you have already encountered such
problem and any solution

Thanks & Regards,

Harish Sohani
Tally Solutions Pvt Ltd.


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Samsung Laser Refill Problem, HP 1018 any better for refill? lbbss Printers 10 October 12th 07 10:37 AM
HP LaserJet 1018 Installation Problem - USB Device Not Recognized [email protected] Printers 0 January 23rd 07 11:03 PM
Fax setup on HP laserjet 3050 yee Printers 1 May 13th 06 12:04 AM
P4C800-E DLX 1018 IDE problem Andre Asus Motherboards 3 October 17th 04 03:53 AM
Problem w/ New Beta BIOS 1018-03 A7V333 Michael O'Donnell Asus Motherboards 0 July 29th 04 08:01 PM

All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ComputerBanter.com.
The comments are property of their posters.