ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEnVect.Proc.PaintPenMarker
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Sep 27 2012 :  07:53:10  Show Profile  Reply
Hello,
I would like to use the ImageEnVect.Proc.PaintPenMarker in a selection.
Here my source code.

if not ImageEnVect.Selected or
ImageEnVect.IsPointInsideSelection(bx,by) then
begin
RGBColor := ImageEnVect.IEBitmap.Pixels[BX, BY];
my_Color := TRGB2TColor ( RGBColor );
quellfarbe:=pen_color;
ImageEnVect.Proc.PaintPenMarker( BX, BY, ra_pen, quellfarbe,My_Color, 255 );
end;

But unfortunately it draws over the selection out.
See picture.

160.74 KB
What do I make wrong?


Klaus
www.klausdoege.de

xequte

38615 Posts

Posted - Sep 30 2012 :  00:38:31  Show Profile  Reply
Hi Klaus

What is the value of ra_pen?

Even though the centre point (BX, BY) is within the selection, the extent of the mark is not.

Unfortunately i can't think of any easy way to avoid that with a freeform selection. Hopefully Fabrizio or Bill have an idea...



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Sep 30 2012 :  13:59:46  Show Profile  Reply
Hello Nigel,
the diameter is 20px about, but it happens with each diameter.
I believe it is tested the rectangle of the selection.
Not the correct selection as circle or polygon.

103.36 KB
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Oct 08 2012 :  12:48:54  Show Profile  Reply
Hello,
is a correction planned here?

Klaus
www.klausdoege.de
Go to Top of Page

xequte

38615 Posts

Posted - Nov 29 2012 :  22:55:19  Show Profile  Reply
Hi Klaus

What version are you using? I cannot reproduce this in v4.1.4.

I tested using this code:

procedure TMainForm.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if ImageEnView1.IsPointInsideSelection(X - ImageEnView1.OffsetX, Y - ImageEnView1.OffSetY) then
    ImageEnView1.Proc.PaintPenMarker(X - ImageEnView1.OffsetX, Y - ImageEnView1.OffSetY, 5, clRed,clBlue, 255 );
end;


And it worked as expected.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Dec 05 2012 :  11:49:51  Show Profile  Reply
Hello Nigel,
I use also v4.1.4
With this code, the same result comes as previously.
The brush draws a rectangular area outside the Selection.

Greetings
Klaus

Klaus
www.klausdoege.de
Go to Top of Page

xequte

38615 Posts

Posted - Dec 06 2012 :  00:54:34  Show Profile  Reply
Hi Klaus

Please create a very small demo to illustrate the issue and email it to me.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 07 2012 :  06:49:08  Show Profile  Reply
I made a simple demo that does not allow you to draw a PaintPenMarker outside of an ellipse selection. If you use the latest version of ImageEn it is simple to do:
1. Create s new VCL Application
2. Drop an ImageEnView on the form, set its align to alClient, set MouseInteract to miSelectCircle, and set SelectionOptions to [iesoAnimated,iesoSizeable,iesoMoveable,iesoCanScroll,iesoDisableOneClickDeselect]
3. In the OnMouseMove Event add
procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if ImageEnView1.IsPointInsideSelection(X - ImageEnView1.OffsetX, Y - ImageEnView1.OffSetY) then
    ImageEnView1.Proc.PaintPenMarker(X - ImageEnView1.OffsetX, Y - ImageEnView1.OffSetY, 5, clRed,clBlue, 255 );
end;


To Test, compile the project and select an ellipse.
Then move the mouse...

The result is painting only takes place inside the selection.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Dec 07 2012 :  08:55:37  Show Profile  Reply
Hello Nigel,
yes that works out.
My Procedure is very extensive, obviously I have another problem there.
I must test it again.
Thanks for your patience.
Greetings
Klaus

Klaus
www.klausdoege.de
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: