Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: How to print what I see
Started by fdupont@hypershell.com at 03-04-2004 15:34. Topic has 4 replies.

Print Search « Previous Thread Next Thread »
  03-04-2004, 15:34
fdupont@hypershell.com is not online. Last active: 12/17/2004 8:30:49 PM fdupont@hypershell.com

Not Ranked
Joined on 03-03-2004
Posts 2
How to print what I see
Reply Quote

Hi!

I got problem printing document.  I want to print a part of an image, I mean the part of the image I zoomed.  I've try many way but didn't find the one I needed.  Suppose I have a BMP with TOTO written in it.  I want to zoom so I see only the middle T in the view window.  After I click the print button and I see on the paper exactly the same things as in the view window.

How I do that??

I tried the following code...

Printer.BeginDoc;
Lead.ScaleMode := 3;
Lead.BitmapToClient(Lead.ScaleWidth, Lead.ScaleHeight);
left := Lead.ConvertX;
top := Lead.ConvertY;
Lead.BitmapToClient(Lead.DstClipWidth, Lead.DstClipHeight);
Lead.SetSrcRect(Lead.DstLeft * (Lead.PaintZoomFactor / 100),
       Lead.DstTop * (Lead.PaintZoomFactor / 100),
       Lead.DstWidth * (Lead.PaintZoomFactor / 100),
       Lead.DstHeight * (Lead.PaintZoomFactor / 100));
Lead.Render(Printer.Handle, 0, 0, 0, 0);

Printer.EndDoc;

Franis


   Report 
  04-16-2004, 9:47
fdupont@hypershell.com is not online. Last active: 12/17/2004 8:30:49 PM fdupont@hypershell.com

Not Ranked
Joined on 03-03-2004
Posts 2
Re: How to print what I see
Reply Quote

HI!

Printer.BeginDoc;

   // Get new coords on screen to be sure
   GetNewPoints;

   // Set LEAD's Source rectangle to selected coordinates on screen
   Lead.SetSrcRect( genX1, genY1, (genX2 - genX1), (genY2 - genY1) );

   // Print the document, detecting the printer's width & height, to 'Fit it to page'
   Lead.Render( Printer.Handle, 1, 1, 0, 0 );

   // Reset LEAD's Source rectangle to original image's width & height
   Lead.SetSrcRect( 0, 0, Lead.BitmapWidth, Lead.BitmapHeight );

   Printer.EndDoc;


   Report 
  08-26-2008, 18:34
JoeBussell is not online. Last active: 12/13/2008 12:04:09 AM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 62
Re: How to print what I see
Reply Quote
I am looking for an answer to this post.  Following the breadcrumbs for printing has not been easy.  I made an attempt to create a GetNewPoints function, but it does not appear to behave as I expected:

Public Sub GetPrintBounds(ByRef left As Single, ByRef top As Single, ByRef width As Single, ByRef height As Single)
    LEAD1.ClientToBitmap 0, 0
    left = LEAD1.ConvertX
    top = LEAD1.ConvertY

    vScrl = 0
    hScrl = 0
    If LEAD1.VScrollInfo.Visible Then
         vScrl = LEAD1.VScrollInfo.width
    End If
    If LEAD1.HScrollInfo.Visible Then
         hScrl = LEAD1.HScrollInfo.width
     End If

     LEAD1.ClientToBitmap LEAD1.ScaleWidth - hScrl, LEAD1.ScaleHeight - vScrl
     width = LEAD1.ConvertX - xBmp
     height = LEAD1.ConvertY - yBmp
End Sub

   Report 
  08-27-2008, 1:00
JoeBussell is not online. Last active: 12/13/2008 12:04:09 AM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 62
Re: How to print what I see
Reply Quote
In the spirit of making things hard for myself I had decided to set the PaintSizeMode to PAINTSIZEMODE_NORMAL for my print.  This resulted in a behavior where my zoomed in views were always at the center of the image.  My best advice could be to leave this alone, but I am going with explicitly setting:

LEAD1.PaintSizeMode = PAINTSIZEMODE_ZOOM

   Report 
  08-27-2008, 8:35
Yasir Alani is not online. Last active: 11/16/2008 11:29:23 AM Yasir Alani



Top 10 Posts
Joined on 02-05-2007
Posts 311
Re: How to print what I see
Reply Quote
It seems you already started a thread about printing issues here:
http://support.leadtools.com/SupportPortal/cs/forums/23222/ShowPost.aspx

If you still face any problems, please post your question in only one forum thread, unless it's a different issue.

For new issues you run into, it's better to start new threads (and possibly mention other threads) instead of replying to very old threads.


Yasir Alani
LEADTOOLS Technical Support
support@leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Printing » Re: How to print what I see

Powered by Community Server, by Telligent Systems