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
 Positioning issue using brush on a layer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

whisper1980

USA
37 Posts

Posted - Sep 10 2020 :  18:29:24  Show Profile  Reply
This is the first time I've played with the brush tool so I might be doing something wrong.

If I load an image as the base layer and use the brush tool to draw, everything is fine.

If I add a rectangle layer for example, this is where something goes wrong. When I start using the brush tool on that layer, the drawing appears to be limited to the top and left edges of the rectangle layer (nothing draws past those edges). There does not seem to be any limits on the bottom and right edges of that layer. That might be as designed, but the problem occurs when I stop drawing. The drawing suddenly moves to the top left of the main base layer as if the the drawing coordinates and the layer coordinates are misaligned.

ImageEn 9.1.1
Delphi 10.4.1


Eric

xequte

5500 Posts

Posted - Sep 10 2020 :  19:08:42  Show Profile  Reply
Hi Eric

I tried to reproduce this in the brush demo:

\Demos\ImageEditing\BrushTool\PaintBrush.dpr

By adding an image layer. But I could not.

Can you give me specific steps to reproduce it in our demo?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

whisper1980

USA
37 Posts

Posted - Sep 11 2020 :  16:43:46  Show Profile  Reply
Just add the following line to uMain.pas just in front of StartPainting() line in the btnOpenClick procedure (line 122-ish)

ImageEnView1.LayersAdd(TIEShape.iesRectangle, IELayer_Pos_HCenter, IELayer_Pos_VCenter, 100, 100);

Run the program and just start painting after you open an image. You will not be able to paint above or to the left of the rectangle and then whatever you painted will snap to the top left in the main image you loaded once you stop painting.


Eric
Go to Top of Page

xequte

5500 Posts

Posted - Sep 11 2020 :  17:15:01  Show Profile  Reply
Hi Eric

Sorry, you cannot paint on non-image layers. You will need to convert them to image layers first, e.g. using:

http://www.imageen.com/help/TImageEnView.LayersConvertToImageLayers.html

I will add an explicit exception to the code to warn of this.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

whisper1980

USA
37 Posts

Posted - Sep 12 2020 :  13:48:20  Show Profile  Reply
Thanks (makes sense). I will disable paint and erase unless the user has selected an image layer. My app allows them to convert other layer types to image layers for other purposes, so that will work.


Eric
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: