Rank: Member
Groups: Guest
Joined: 7/6/2006(UTC) Posts: 3
|
This is the current sample code Im working with but the results are not what Im looking for. Im looking for the alpha channel to stay transparent, If I remove the flatten alpha channel all that I get is a black border and no shading. with the Flatten alpha channel it makes it shade to white. Is there a way to use the graphics and draw this effect im looking for with Opacity? ~ Taiowa Code:'Define scale factor
Dim scale As Single = 0.5
'Calculate new size and resize image
bitmap.Transforms.Resize(bitmap.Width * scale, 0)
'Convert to format with alpha channel
If Not bitmap.HasAlpha Then
bitmap.Channels.AddAlpha(1)
End If
bitmap.Transforms.Shadow(Aurigma.GraphicsMill.RgbColor.Black, 4, 4, 10, True)
'Flatten alpha channel
'bitmap.Channels.DiscardAlpha(Aurigma.GraphicsMill.RgbColor.White)
. Edited by user Wednesday, December 19, 2007 4:06:01 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, I have tried the following code: Code: Dim bitmap As New Aurigma.GraphicsMill.Bitmap("d:/images/test/1.jpg")
Dim scale As Single = 0.5
bitmap.Transforms.Resize(bitmap.Width * scale, 0)
If Not bitmap.HasAlpha Then
bitmap.Channels.AddAlpha(1)
End If
bitmap.Transforms.Shadow(Aurigma.GraphicsMill.RgbColor.Black, 4, 4, 10, True)
bitmap.Save("d:/temp/shadow.png")
If you open file shadow.png in Photoshop, you will see image with gradient shadow. Shadow is defined in alpha channel - alpha channel of shadow fades from inner to outer space. If you don't need alpha channel, you should blend your shadowed image with some background or another image. Edited by user Wednesday, December 19, 2007 4:06:31 PM(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 7/6/2006(UTC) Posts: 3
|
yes if you open the image in adobe it has the transparency as you can see from test.png. If you view the file in Internet Explorer it doesnt show the transparency it has a gray outline as shown below in the picture. In the .net app it is unable to read that transparency as well I have attached my results in using the Shadow. The shadow effect works fine on the letter A, as its orginal image is already a PNG, however the other 2 original Images are JPG. If I dont discard the alpha as you can see in the attached shadow.jpg the ones that were originally JPG dont display the transparency only a solid black outline, however if I discard the alpha it shows the correct effect however now its flat of course and not transparent. How do I get the desired Shadow Result if the Originals are JPG like it does for the Letter A? ~Taiowa Edited by user Monday, December 21, 2009 3:02:53 AM(UTC)
| Reason: Not specified Taiowa attached the following image(s):
|
|
|
|
Rank: Member
Groups: Guest
Joined: 7/6/2006(UTC) Posts: 3
|
Thanks for your help, I found that my code was changing the alpha on the entire layer when a JPG was used. Now I need to find away to apply alpha across the entire PNG file and keep the current transparency any help would be appreciated. Your GraphicsMill.Net Rules.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, If you don't handle alpha channel by yourself and save result to JPEG format, Graphics Mill for .NET just discards alpha because of JPEG format doesn't support alpha channels. That is why you get incorrect result. Instead of this you should decide how to remove alpha by yourself. Thanks for your warm words. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/4/2007(UTC) Posts: 23
|
Hi, I have attached an image which contains 2 text Testing (upper) and Testing (written on lower side). I have applied Drop shadow effect on the Testing text appearing in the upper portion using Aurigma. But I want to acheive the shadow effect as on the Testing written down it. How do I acheive it through Aurigma?
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/4/2007(UTC) Posts: 23
|
Forgot to attach the file.Here it is.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Attachment cannot be opened. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/4/2007(UTC) Posts: 23
|
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/4/2007(UTC) Posts: 23
|
Hi, Here is the attachment. vandna attached the following image(s):
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, As I undrestood - you have background bitmap onto which you want to draw 2 text strings with shadow. So you should draw text string on temporary bitmap, apply Shadow transform and then draw it on background bitmap. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/4/2007(UTC) Posts: 23
|
Hi Dmitry, I guess you understood me wrong. I need to give the shadow effect as given in the text written in lower section. The shadow is multiplied with the background.However, in case I use the Transforms shadow effect, I get an effect like in the text written in the upper portion.How do I acheive the effect as in the text in the lower section?
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, To say something I need to look through your code sample which you use to draw text with shadow. |
|
|
|
|
Forum Jump
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.