VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1[2]345678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 00:33:24 11/12/03 Wed
Author: JK
Subject: Re: Pls check my sample code again ?
In reply to: Michel 's message, "Re: How to print a current view ?" on 07:51:25 11/11/03 Tue


Hi Michel,

I dont know how to set the rect informats. Please check
my sample code.

var
rect : TRect;
Transform : TCropTransform;
GraphicPrinter : TDibGraphicPrinter;
Graphic : TDibGraphic;
CropForm : TCropForm;
Left : LongInt;
Top : LongInt;
Right : LongInt;
Bottom : LongInt;
xPos,yPos : LongInt;
begin
Rect := ImageScrollBox.ImageRect;
xPos := ImageScrollBox.HorzScrollBar.Position;
yPos := ImageScrollBox.VertScrollBar.Position;
Graphic := ImageScrollBox.DisplayedGraphic;
FUndoGraphic.Assign(Graphic);
Transform := TCropTransform.Create;
try
Transform.OnProgress := Self.OnProgress;
Transform.Left := ??? //Rect.Left;
Transform.Right := ??? //Rect.Right;
Transform.Top := ??? //Rect.Top;
Transform.Bottom := ??? //Rect.Bottom;
//Transform.ApplyOnDest(FUndoGraphic, Graphic);

GraphicPrinter := TDibGraphicPrinter.Create;
GraphicPrinter.UsePrintJob := False;
GraphicPrinter.PrintMode := pmOriginalSize; //pmStretchToPage; //pmFullPage;
Printer.PrinterIndex := -1;
Printer.Title := ExtractFilename(ImageScrollBox.FileName);
Printer.BeginDoc;
GraphicPrinter.Print(Graphic);
Printer.EndDoc;
GraphicPrinter.Free;

finally
Transform.Free;
end;


>
>Hi JK,
>
>You will need to combine a few things to do this.
>TImageScrollBox has a property call ImageRect which
>will give the coordinates of the TImage on the
>TImageScrollBox.
>
>You will also need the position of the scroll bars,
>ImageScrollBox.HorzScrollBar, VertScrollBar.Position
>to deterimine the offset in the displayed graphic.
>
>Then you can use the TCropTransform to extract the
>current view on the ImageScrollBox.DisplayedGraphic.
>
>Best regards,
>
>Michel
>
>
>>
>> Hi All,
>>
>> I want to print the current display after zoom in,
>>zoom out
>> and zoom pan. How can i do this ?
>>
>> Regards,JK

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:

  • Re: Please check my code ? -- JK, 00:40:39 11/12/03 Wed
  • Re: Please check my code ? -- Michel, 18:10:29 11/13/03 Thu
    [ Contact Forum Admin ]


    Forum timezone: GMT-5
    VF Version: 3.00b, ConfDB:
    Before posting please read our privacy policy.
    VoyForums(tm) is a Free Service from Voyager Info-Systems.
    Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.