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: 12345[6]78910 ]


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

Date Posted: 19:52:21 02/18/02 Mon
Author: Michel
Subject: Re: Question about the CopySelectionToClipBoard
In reply to: Jean-Michel Gaudette 's message, "Question about the CopySelectionToClipBoard" on 08:26:17 02/18/02 Mon


Bonjour Jean-Michel,

Here is a new implementation that uses the original graphic, not the displayed graphic.

Best regards,

Michel


procedure TRubberbandMouseHandler.CopySelectionToClipBoard;
var
Rect : TRect;
Graphic : TDibGraphic;
CropTransform : TCropTransform;
DisplayedGraphic : TDibGraphic;
SourceWidth : Integer;
SourceHeight : Integer;
begin
if not SelectionActive then
raise ERubberbandError.Create(msgRegionNotSelected);

DisplayedGraphic := TDibGraphic(FImageScrollBox.FImage.Picture.Graphic);

SourceWidth := FImageScrollBox.FSourceGraphic.Width;
SourceHeight := FImageScrollBox.FSourceGraphic.Height;

Rect.Top := FY1 * SourceHeight div DisplayedGraphic.Height;
Rect.Bottom := FY2 * SourceHeight div DisplayedGraphic.Height;
Rect.Left := FX1 * SourceWidth div DisplayedGraphic.Width;
Rect.Right := FX2 * SourceWidth div DisplayedGraphic.Width;

AdjustRect(Rect);

if ((Rect.Right - Rect.Left) >= 1) and
((Rect.Bottom - Rect.Top) >= 1) then
begin
Graphic := TDibGraphic.Create;
CropTransform := TCropTransform.Create;
try
CropTransform.Top := Rect.Top;
CropTransform.Left := Rect.Left;
CropTransform.Bottom := SourceHeight - Rect.Bottom;
CropTransform.Right := SourceWidth - Rect.Right;

CropTransform.ApplyOnDest( FImageScrollBox.FSourceGraphic, Graphic);

Clipboard.Assign(Graphic);

finally
CropTransform.Free;
Graphic.Free;
end;
end;
end;



>I need to print the selection of 400dpi Tiff Group 4
>files.
>I try to use CopySelectionToClipBoard and assign the
>content of the ClipBoard to a ppImage of my
>reportBuilder report
>
>ppImage1.Picture.Bitmap.LoadFromClipBoardFormat(cf_BitM
>ap,ClipBoard.GetAsHandle(cf_Bitmap),0);
>
>The print quality is bad. I need the same print
>quality of the original file (400dpi). How can i do
>that ..
>
>Thanks for your support ...
>
>jmg

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

[ 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.