Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Transparent Images and Alignment (Read 1339 times)
jstraylor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Dec 28th, 2006
Transparent Images and Alignment
Mar 13th, 2007 at 12:01pm
Print Post  
Hello,

We are having a minor problem with a PNG that has a transparent color set and it's alignment in a box.

What we are trying to do is use the box background color as the fill color for our PNG, so we use something like

box.fillcolor = color.red
box.image = image.fromfile("image.png")
box.imagealign = imagealign.stretch

And what happens is that we sometimes get a line of 1 (or less) pixel around the outside edge of the PNG that is placed on the box.  I have tweaked the box.pen.width to .25, but beyond that it starts to encroach on the image that we are showing.

Is there any way to force a "full fit" of the image to the box??  As an alternative, do I need to play with the image size and box size to make sure that the size ratios are exactly the same??

I can post the png image itself and box sizes if needed.

Thanks,
Jeff
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Transparent Images and Alignment
Reply #1 - Mar 13th, 2007 at 12:21pm
Print Post  
Hi,

Could you send me the image and a screenshot showing the problem?

Thank you,
Stoyan
  
Back to top
 
IP Logged
 
jstraylor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Dec 28th, 2006
Re: Transparent Images and Alignment
Reply #2 - Mar 16th, 2007 at 2:13pm
Print Post  
Just posting the solution for anyone else who encounters a similar problem.

> That looks like some rounding error in the Graphics.DrawImage method, to
> > which we pass the Box.BoundingRect when drawing a stretched image. For
now,
> > try setting a slightly larger ImageRectangle in the ShapeTemlpate used
with
> > that box, e.g. (0, 0, 100.01, 100.01).

Works like a champ.

Jeff
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint