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
 Problem ImageEnVect.UpdateRect in v7.5.0
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Jan 03 2018 :  11:31:19  Show Profile  Reply
Hello,
I have been using the following procedure as a brush for many years.
Since the new version 7.5.0 I have problems.
It will always display a white square when painting.
That's the same with the PaintPenMarker.
What can I do, you can check the problem.
When i use imageenvect.update, then all OK but slow.
imageenvect.UpdateRect() works quickly.

// Source Example:
if painting then
begin
  px_source := snap_form.imageenview1.bitmap.Scanline[yo];
  px_dest := ImageEnVect.IEBitmap.Scanline[yo];
  for rax := -ra_brush to ra_brush do
  begin
    quellfarbe := rgb(px_source[xo].r, px_source[xo].g, px_source[xo].b);
    zielfarbe := rgb(px_dest[xo].r, px_dest[xo].g, px_dest[xo].b);
    fa := clonmischfarbe(quellfarbe, zielfarbe);
    px_dest[xo] := TColor2TRGB(fa);
  end
end
else
   ActiveChild.ImageEnVect.Proc.PaintPenMarker(bx, by, 2 * ra_brush,brush_color, magicbrush_color, Deckung);

   toolrect.Top := by - ray;
   toolrect.Left := bx - rax;
   toolrect.Bottom := by + ray;
   toolrect.Right := bx + rax;
   ImageEnVect.UpdateRect(toolrect):




Best regards

Klaus
www.klausdoege.de

w2m

USA
1990 Posts

Posted - Jan 03 2018 :  14:16:45  Show Profile  Reply
UpdateRect includes new parameters in 7.5:
Declaration

procedure UpdateRect(rclip: TRect; UpdateNow: Boolean = false);

Description
Updates the specified rectangle. Use this function instead of Update when only a portion of the image has changed.
If UpdateNow is True then the window is updated immediately (bypassing the application queue).

so try this:
imageenvect.UpdateRect(toolrect, True)

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

klausdoege

Germany
389 Posts

Posted - Jan 04 2018 :  09:11:37  Show Profile  Reply
Hi Bill,
with ImageEnVect.UpdateRect(toolrect, true)
I have the same effect, a white square.
-------------------------------------------
Now I changed it as follows and it works perfect.
ImageEnVect.LockPaint;
ImageEnVect.UpdateRect(toolrect)
ImageEnVect.UnLockPaint;
-------------------------------------------
ImageEnVect.LockPaint;
ImageEnVect.UpdateRect(toolrect, true)
ImageEnVect.UnLockPaint;
It works, but it's slower.
-------------------------------------------
Maybe you can consider and change this in the next version.

Klaus
www.klausdoege.de
Go to Top of Page

xequte

38198 Posts

Posted - Jan 04 2018 :  20:58:29  Show Profile  Reply
Hi Klaus

There is too many unknown variables in your example code to reproduce the issue. Can you give me something simpler?

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