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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEn problem (zoom with effects)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
leo Posted - Apr 20 2012 : 13:19:58
Hello,

I found a problem in the component ImageEN. When apply an effect (operation) in the image, the viewer is zoomed or increase the zoom, at a certain time the image is all white or colors are lost.

To reproduce the problem, use the demo "Layer Editing" group "Image Editing Demos" and use the effect "Negation" or "MAX (Lighten)."
The demo is available in http://www.xequte.com/imageen/demos/ImageEditing/Layers/Layers.exe

I use Delphi XE2 Update3 with the operating system Windows 7 64Bit.

I detected this problem by using DICOM images with TImageEnVect. But it is possible to simulate any type of image and using the TImageEnView.

There is a solution (code) around this problem?
3   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Apr 22 2012 : 23:36:21
It is normal. If background is "black" means it is composed by all zeros (0,0,0).
If you "Add" -> image:(A,B,C) + background:(0,0,0) = A,B,C, so it not changes
If you "Multiply" -> image:(A,B,C) * background:(0,0,0) = 0,0,0 all black
...etc...
leo Posted - Apr 22 2012 : 18:59:23
Ok Fabrizio, the fix worked. Thank you for quick resolution.

I have another problem. Using the same demo "Layer Editing", change the BackgroudStyle property to "iebsSolid," and the Background property to "clBlack."
When applying effects (operation), most of them are not applied.
To simulate, make changes and recompile the demo. Open any image, go on the "effects" and proceed by applying the operations available and see the result.
Sometimes the image is all black, and sometimes nothing happens.

I tested with the types of images "jpg" and "dicom".

Thanks.
fab Posted - Apr 20 2012 : 15:19:11
Thank you!

The fix is in imageenview.pas unit, at TImageEnView.PaintToEx method, replace function SubDrawBackground with

procedure SubDrawBackground(force: boolean);
  var
    bHandledBG:boolean;
  begin
    if force or
       (fOffX > 0) or
       (fOffY > 0) or
       (frx < ABitmap.Width) or
       (fry < ABitmap.Height) or
       (fEnableAlphaChannel and lBitmap.HasAlphaChannel and (not lBitmap.AlphaChannel.Full)) or
       (IsFirst and (layer.Operation <> ielNormal)) or 
       (Transparency < 255) then
    begin
      if UpdRect <> nil then
      begin
        with UpdRect^ do
          IntersectClipRect(ABitmap.Canvas.Handle, left, top, right + 1, bottom + 1);
      end;
      bHandledBG:=false;
      if assigned(fOnDrawBackground) then
        fOnDrawBackground(self, ABitmap.Canvas, Rect(0, 0, ABitmap.Width, ABitmap.Height), bHandledBG);
      if bHandledBG=false then
        IEDrawBackground(ComponentState, ABitmap.Canvas, ABitmap.VclBitmap, fBackgroundStyle, fBackGround, 0, 0, ABitmap.Width, ABitmap.Height, fOffX, fOffY, fOffX + frx, fOffY + fry, fChessboardSize, fChessboardBrushStyle, fGradientEndColor, fWallPaper,fWallPaperStyle);
      SelectClipRgn(ABitmap.canvas.handle, 0);
    end;
  end;