Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with StretchDraw to a printer canvas

Posted on 1999-07-25
5
Medium Priority
?
1,280 Views
Last Modified: 2012-06-27
Hi,

I have a small problem using StretchDraw to the printer canvas.  The problem is that the image is not visible when the report is printed on the printer or printed to Acrobat.  This section of the code has been newly written.  This has been seen on different computers with the same results.

The size and position are correct (I only know this because if I use CopyMode cmBlackness, the correct image size and location are evident.  I know that the image was successfully loaded because I did a test StretchDraw to a TImage canvas (using different DrawRect) after the StretchDraw to the printer canvas and the image was visible.

I have tried various CopyModes without success.  This has been primarily tested under Windows 98.

What is happening?

Thank you,
MP

    LogoBitmap:=TBitmap.Create;

    With Printer.Canvas Do
      Try
        Try
          LogoBitmap.LoadFromFile(Cfg.LogoName);
        Except
          ShowMessage('Error reading logo:  '+Cfg.LogoName);
          Exit;
        End;

        DrawRect:=...

        CopyMode:=cmSrcCopy;
        StretchDraw(DrawRect,LogoBitmap);
      Finally
        LogoBitmap.Free;
      End;

0
Comment
Question by:mikepj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391020
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1391021
try this..

b := tbitmap.create;
b.loadfromfile('whatever');
drawrect := rect(0, 0, 100, 100);
printer.begindoc;
printer.canvas.stretchdraw(drawrect, b);
printer.enddoc;
b.free;

This might work.. try it out..

..-=ViKtOr=-..
0
 
LVL 2

Author Comment

by:mikepj
ID: 1391022
Thank you for your message.

This was basically what I was doing.  Epsylon's suggestion fixed the problem.  VERY interesting!

If Epsylon could submit the comment as an answer, I would be pleased to accept the answer.

Thank you for your help!
MP

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391023
Thanks Mikepj, glad my suggestion helped you     :o)

Cheers,

Epsylon.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 400 total points
ID: 1391024
Thanks Mikepj, glad my suggestion helped you     :o)

Cheers,

Epsylon.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question