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
 Floating point division by zero in ImageEnProc

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
ksv1991 Posted - Aug 20 2011 : 02:40:20
Hello,

I have tried ImageEnProc.Rotate procedure, but i receive message "Floating point division by zero" in module ImageEnProc on row:
per := 100 / (dst.Height);

Why can it happen?
5   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Aug 20 2011 : 08:33:58
Please execute this:
Proc:=TImageEnProc.CreateFromBitmap(Image);
Proc.Rotate(45, true, ierFast, clWhite);  // << "true" instead of "false"

For optimization reasons Rotate, with antialias disabled, sets always background to black.
ksv1991 Posted - Aug 20 2011 : 06:43:21
The sample of code:


Proc:=TImageEnProc.CreateFromBitmap(Image);
Proc.Rotate(45,false,ierFast,clWhite);



The image is in binary format (PixelFormat:=ie1g). Image not has alpha channel.
But result is here:

fab Posted - Aug 20 2011 : 05:38:06
Rotate method allows to specify the color of the new area necessary to make rotated image.
For example, this...

ImageEnView.Proc.Rotate(45, false, ierFast, clRed);

...will fill the added angles with clRed.

If you want to change the background of the image then there are other options, depending by the image (has it alpha channel? has it a specific previous background color?).

Please add details, code and images if possible.
ksv1991 Posted - Aug 20 2011 : 05:14:43
Problem was solved independently. It was not working, because wrong image was loaded in the ImageEnProc.

But now there's another problem:
I can not change the background color of the rotated image. I put the value of: 0, 255, 1, clWhite, but background is always black.
fab Posted - Aug 20 2011 : 04:02:54
Hello,
please add other details:

1) is the TImageEnProc component attached to another component like TImageEnView, TIEBitmap, etc...?

2) which is the size of the image? How have you loaded it?