• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Black background when rotate an image

Started by dec, 19 January 2013, 18:13:49

Previous topic - Next topic

dec

Hello,

First of all, thank you very much for your work at Vampyre Imaging Library, in my opinion one of the best tools to work with images from Delphi. I have a question that cannot solved by myself. When rotate an image (supose a Bitmap) using "Imaging.RotateImage()", we have some option in order to set the background color instead get the "default" black background?

Thank you very much in advance.

dec

Hello there,

I continue needed some help with the above question. Can somebody help me? Thanks!

Galfar

Hello,
unfortunately it's not possible to set the background color with currently implemented rotation method.
One option is to blend the rotated image to another image filled with desired background color.
Image to be rotated must be converted to some format with alpha channel - background after rotation will
be not only black but also transparent.

Check out Deskew for code to merge image with background:
https://bitbucket.org/galfar/app-deskew/src/d9ee5df8742884404bf8df06ed7e0b2aab88ee8f/ImageUtils.pas?at=default#cl-149

dec

Hello,

Thank you for your answer Galfar. I'll take a look at your refered code. Thank you again.

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk