Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Hardware Support > Printer Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Printer Support Support Forum for printers: HP, Brother, Epson, Canon

Reply
 
LinkBack Thread Tools
Old 05-06-2008, 09:46 AM   #1 (permalink)
Registered User
 
Join Date: May 2008
Posts: 1
OS: Windows XP


Problem while performing stretch on HP 1010, HP 1018, HP 1020 and HP 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.

Explaination
-----------

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 severla 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.
Bangalore.
Mob: 99020 16227
harish.sohani is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Reply


Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 04:29 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85