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
 Pen size
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
497 Posts

Posted - Jul 11 2015 :  08:32:13  Show Profile  Reply
I am trying to be able to change the pen size of the small circle handles when i have a selection. (Could be box or circle).

I use the Imageenvect.ObjGripPen.Width := StrToInt(sSpinEdit_GripPenSize.Text);
Imageenvect.update;

That does not work.

What am i doing wrong?

Thanks.
Pierre

w2m

USA
1990 Posts

Posted - Jul 11 2015 :  12:51:59  Show Profile  Reply
ImageEnVect1.ObjGripPen.Width := StrToIntDef(PenWidth1.Text, 5);
ImageEnVect1.Update;

works for me... this is different than
if iHObj <> -1 then
ObjPenWidth[iHObj] := StrToIntDef(BrushSize1.Text, 5);

Are you calling Update after you set the GripPenWidth?

Are you trying to set an objects pen width or the grips pen width?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 11 2015 :  14:35:37  Show Profile  Reply
Bill, i am trying to set the grips pen width.
Thanks.
Pierre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 11 2015 :  14:40:30  Show Profile  Reply
this works:
ImageEnVect1.ObjGripPen.Width := StrToIntDef(PenWidth1.Text, 5);

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 11 2015 :  15:43:29  Show Profile  Reply
That is what I thought. I know it used to work but not in my current code. Need to find out what is creating the problem then.
Thanks for checking.
Pierre
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 11 2015 :  20:39:52  Show Profile  Reply
Ok maybe what i want to do is different. i am calling
MouseInteract := MouseInteract + [miSelectPolygon];

so i have a rectangle selection with yellow circle and marching ants.
with that, i can copy or cut part of the image.

This is the width and size of the yellow circle i am trying to change.
I modified the vectorial demo with the code you gave me and that does not change.

Advice?
Thanks.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 12 2015 :  08:56:59  Show Profile  Reply
procedure TForm1.BrushSize1Change(Sender: TObject);
var
  i: Integer;
  iHObj: Integer;
begin
  if StrToInt(BrushSize1.Text) > 1 then
    ImageEnVect1.HighlightedPixel := Point(-1, -1);
  PenSizeScrollBar1.Position := StrToInt(BrushSize1.Text);
  if (StrToInt(BrushSize1.Text) = 1) and ((Draw1.Down) or (Erase1.Down)) then
    ImageEnVect1.Cursor := crIEPencil
  else if (Draw1.Down) or (Erase1.Down) then
    ImageEnVect1.Cursor := crIEBrush;
  iHObj := -1;
  if ImageEnVect1.ObjectsCount > 0 then
    with ImageEnVect1 do
      for i := -1 to SelObjectsCount - 1 do
      begin
        if i >= 0 then
          iHObj := SelObjects[i];
        if iHObj <> -1 then
          ObjPenWidth[iHObj] := StrToIntDef(BrushSize1.Text, 5);
      end;
  ImageEnVect1.Update;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 12 2015 :  10:21:00  Show Profile  Reply
Bill, i do not think this is what i am trying to do. It is more inline with the setgripstyle command.
I have attached the vectorial demo modified. You will have to run it as all the uneeded components are not visible when you do so. Only 2 are going to be left on the form. You'll know waht i am trying to accomplish the,
Thanks for the help.
Pierre

attach/pierrotsc/2015712101843_Vectorial.zip
16.42 KB
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 12 2015 :  10:24:20  Show Profile  Reply
You only have 2 choices. Set the grip pen width or the objects pen width and I have shown you how to do both. There are no other choices.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 12 2015 :  10:36:38  Show Profile  Reply
Oh Dear, you were not even talking about objects at all. You were referring to selection grips. Pierre, you should try to describe what you are trying to do better so you get the correct help.
ImageEnVect1.SetSelectionGripStyle(clWhite, clRed, bsSolid, strtointdef(Edit2.Text, 5), True, iegsCircle);

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 12 2015 :  10:50:29  Show Profile  Reply
Well, that does not change the pen size :) I am aware of that. it makes the circle or the box bigger but does not change its thickness.
Sorry if i did not make my question clearer..
So, can that be done?
Apologize for all the confusion.
Pierre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 12 2015 :  10:52:53  Show Profile  Reply
Unfortunately I still do not understand. What do you mean by "thickness"?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 12 2015 :  11:54:29  Show Profile  Reply
The thickness of the circle's pen. The more i think about it, it really does not matter as long i can change the size of the circle.
Never mind..
I really wasted a whole thread :(

Really appreciate your patience.
Pierre
Go to Top of Page

xequte

38510 Posts

Posted - Jul 13 2015 :  19:36:30  Show Profile  Reply
Hi Pierre

Yes, I'm afraid the pen of the selction grip cannot be set.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: