Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, February 28, 2008 8:13:23 AM(UTC)
GregMcFarland

Groups: Registered
Posts: 10


I have an image that I am trying to rotate that has a region defined. All image area outside the region is currently transparent. It is not clear to me how to use the L_RotateBitmap function and have the additional area added to the image also appear as transparent. Is there an easy method to achieve this effect?

Thanks
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, February 28, 2008 9:23:48 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Are you just trying to rotate the entire image rather than just the region?  If so, then all you should have to do is get rid of the region with the L_FreeBitmapRgn method and then L_RotateBitmap will work with the entire image.

If this isn't what you're trying to do, please explain in more detail.  Posting a before and after of what you're trying to accomplish would be very helpful.
 
#3 Posted : Thursday, February 28, 2008 10:05:54 AM(UTC)
GregMcFarland

Groups: Registered
Posts: 10


I have an image with a region. I display the area inside the region and the area outside the region is transparent. When I rotate the entire image using L_RotateBitmap() it takes a crColorRef to use to fill in the newly created area. I want this newly created area to be transparent. Not sure if this is making any sense.
 
#4 Posted : Thursday, February 28, 2008 11:23:50 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


What kind of transparency are you using?

If it's just a color transparency, then all you should have to do is make the crColorRef the same color as your transparent color.

If you're using Alpha Channels then that will be a little more complicated.

Please send some before and after images so i can see exactly what is happening.
 
#5 Posted : Thursday, February 28, 2008 11:58:58 AM(UTC)
GregMcFarland

Groups: Registered
Posts: 10


Hope this makes sense. In the before image the yellow section represents the transparent area that is not part of the region. It is only yellow for demonstration purposes. After rotating the bitmap I end up with a bitmap the size of the after image with the yellow area still not part of the region and the red area is the newly added part of the image. However I want to add this red area to the yellow area as part of the image not included in the region. Again the colors are for representation only. I am using a region that has many different color both inside and outside the region. Hope this makes more sense.
File Attachment(s):
image.zip (136kb) downloaded 18 time(s).
 
#6 Posted : Friday, February 29, 2008 3:25:33 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Thanks for the images, I'm pretty sure I'm understanding you now.  You want to rotate the image and then select the same region you had selected before?

You're probably going to have to do two rotations.  One is your real rotation while your second is a mask image that you'll apply the same rotation to behind the scenes.  Here's what you could do:

1.
Make a copy of your bitmap.  We'll call bitmap1 the original and bitmap2 the copy.

2.
In bitmap 2, create a region of all of the pixels you want to be transparent and fill it with black.  Then select the inverse of that region and fill with white.

3.
Rotate both images by the same amount.  In bitmap2, make sure you make the fill color is black.

4.
Use L_SetBitmapRgnFromMask to select the region again in bitmap1 using bitmap2 as your mask.
 
#7 Posted : Monday, March 3, 2008 3:07:22 AM(UTC)
GregMcFarland

Groups: Registered
Posts: 10


I will give this a try. Sounds like it should do the trick. Thanks for your assistance, I have been racking my brains and couldn't figure it out.
 
#8 Posted : Monday, March 3, 2008 7:33:19 AM(UTC)
GregMcFarland

Groups: Registered
Posts: 10


Just wanted to let you know that what you suggested got me on track and it works just like I needed. Thanks again.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.080 seconds.