[ 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: 04:58:11 01/18/02 Fri
Author: Dmitri
Subject: Re: How to select a part of a picture und paste the selection as a new picture...
In reply to: Michel 's message, "Re: How to select a part of a picture und paste the selection as a new picture..." on 18:03:08 01/17/02 Thu

Hi Michel,
we had found the solution for my 1. question already, but although thank you very much for your answer and the code!
I will try to find a solution for my 2. question...

Thank you for your realy good support!

Best regards,

>Hi Dmitri,
>For question 1,
>Replace the .CropToSelection method in EnRubber.Pas
>with the one below.
>For question 2,
>Envision does not have support to drag with the mouse
>a sub image onto another one. This is not trivial to
>do. The EnRubber.Pas file shows how to use a Canvas on
>the image scroll box directly to draw on it without
>drawing on the source image itself. You would need to
>use a similar technique to drag on screen the image,
>then paste the image in the graphic once the user is
>Best regards,
>procedure TRubberbandMouseHandler.CropToSelection;
> Rect : TRect;
> Graphic : TDibGraphic;
> CropTransform : TCropTransform;
> DisplayedGraphic : TDibGraphic;
> SourceWidth : Integer;
> SourceHeight : Integer;
> if not SelectionActive then
> raise
> DisplayedGraphic :=
> SourceWidth :=
> SourceHeight :=
> Rect.Top := FY1 * SourceHeight div
> Rect.Bottom := FY2 * SourceHeight div
> Rect.Left := FX1 * SourceWidth div
> Rect.Right := FX2 * SourceWidth div
> 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 -
> CropTransform.Right := SourceWidth -
> CropTransform.ApplyOnDest(
>FImageScrollBox.FSourceGraphic, Graphic);
> FImageScrollBox.Graphic.Assign(Graphic);
> FImageScrollBox.Redraw ( True );
> finally
> CropTransform.Free;
> Graphic.Free;
> end;
> end;
>>Hi Michel,
>>Thank you for your answer, I will try your suggestion.
>>I still have 2 questions:
>>1)In your DemoProject is the selected graphic, that I
>>paste as a new graphic smaller then the original. If I
>>resize the new graphic then the quality is worse. How
>>can I get the original size?
>>2)How can I drag the selection to the other graphic?
>>Best regards,
>>>Hi Dmitri,
>>>I am not sure I understand the complete details, but
>>>you can use the ImageScrollBox.Graphic.Canvas.Draw
>>>method to paste a graphic onto another graphic.
>>>For example you can create a DibGraphic, assign it
>>>contents from the clipboard and then paste it to an
>>>DibGraphic := TDibGraphic.Create;
>>>Best regards,
>>>>Hi, can anybody say me how I can select a part of a
>>>>picture (to get the coords) and:
>>>>1) paste the selection as a new picture and resize
>>>>2) paste the selection into a new ImageScrollBox A,
>>>>then select a part of an other picture and paste
>>>>second selection into the same ImageScrollBox A, so
>>>>have a new picture builded up from parts of other
>>>>With best regards, Dmitri

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