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
 Rotate Background Color issue

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
jeffp Posted - Jan 17 2017 : 14:49:27


I'm call this method

TImageEnProc.Rotate(AAngle, False, ierFast, clWhite);

But it doesn't seem to respect the backround color of clWhite. The rotate occurs correctly but the new regions generated by rotate are filled with Black.



jp
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 19 2017 : 18:26:02
Hi

I tried to reproduce as follows:

procedure Tfmain.Button1Click(Sender: TObject);
const
  AAngle = 45;
var
  H1, W1, H2, W2: Integer;
  B: TIEBitmap;
  P: TImageEnProc;
  AFlag: Boolean;
begin
  try
    B := TIEBitmap.Create;
    P := TImageEnProc.CreateFromBitmap(B);
    try
      B.Read( 'D:\bmpout.bmp' );

      if (Abs(AAngle) > 0) then
      begin
        P.Rotate(AAngle, False, ierFast, clWhite);;
        P.Update;
      end;
      B.Write( 'D:\bmpout_Save.bmp' );

    finally
      B.Free;
      P.Free;
    end;
  except end;
end;


The background was set correctly as white.

I suspect the issue is the nature of the image you are processing, or that what you consider as "Black" is actually alpha, and the display app does not support Alpha.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
jeffp Posted - Jan 19 2017 : 09:49:09
No I'm not. Why won't this work.

function IMG_DeskewDib(HDib: Integer; AAngle: Double = -1): Cardinal;
var
  H1, W1, H2, W2: Integer;
  B: TIEBitmap;
  P: TImageEnProc;
  AFlag: Boolean;
begin
  Result := HDib;
  try
    B := TIEBitmap.Create;
    P := TImageEnProc.CreateFromBitmap(B);
    try
      B.CopyFromDIB(HDib);
      H1 := B.Height;
      W1 := B.Width;
      AFlag := (AAngle = -1);
      if AFlag then AAngle := P.SkewDetectionFine(0, 0.1, 10, False);
      if (Abs(AAngle) > 0) then
      begin
        P.Rotate(AAngle, False, ierFast, clWhite);
        if AFlag then B.Resize(W1, H1);
        P.Update;
      end;
      Result := B.CreateDIB;
      GlobalFree(HDib);
    finally
      B.Free;
      P.Free;
    end;
  except end;
end;


jp
xequte Posted - Jan 19 2017 : 04:20:50
Hi Jeff

Are you connected to an TImageEnView? i.e. ImageEnView1.Rotate(AAngle, False, ierFast, clWhite);

Is it a full color image? Can you attach it for testing?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com