Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Taiowa  
#1 Posted : Thursday, July 06, 2006 2:10:33 PM(UTC)
Taiowa

Rank: Member

Groups: Member
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

Dmitry  
#2 Posted : Thursday, July 06, 2006 9:56:55 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
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

Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
Taiowa  
#3 Posted : Thursday, July 06, 2006 11:55:13 PM(UTC)
Taiowa

Rank: Member

Groups: Member
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 UserPostedImage UserPostedImage

Edited by user Monday, December 21, 2009 3:02:53 AM(UTC)  | Reason: Not specified

Taiowa attached the following image(s):
shadow.jpg
test.png
Taiowa  
#4 Posted : Friday, July 07, 2006 6:12:57 AM(UTC)
Taiowa

Rank: Member

Groups: Member
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.
Dmitry  
#5 Posted : Friday, July 07, 2006 11:12:51 AM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
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.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
vandna  
#6 Posted : Monday, January 08, 2007 5:09:31 PM(UTC)
vandna

Rank: Member

Groups: Member
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?
vandna  
#7 Posted : Monday, January 08, 2007 5:12:22 PM(UTC)
vandna

Rank: Member

Groups: Member
Joined: 1/4/2007(UTC)
Posts: 23

Forgot to attach the file.Here it is.
Dmitry  
#8 Posted : Monday, January 08, 2007 7:15:07 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Attachment cannot be opened.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
vandna  
#9 Posted : Monday, January 08, 2007 8:03:04 PM(UTC)
vandna

Rank: Member

Groups: Member
Joined: 1/4/2007(UTC)
Posts: 23

Here it is.
vandna  
#10 Posted : Monday, January 08, 2007 8:07:22 PM(UTC)
vandna

Rank: Member

Groups: Member
Joined: 1/4/2007(UTC)
Posts: 23

Hi, Here is the attachment.
vandna attached the following image(s):
Shadow Test1.jpg
Dmitry  
#11 Posted : Tuesday, January 09, 2007 6:05:48 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
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.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
vandna  
#12 Posted : Wednesday, January 10, 2007 2:12:39 PM(UTC)
vandna

Rank: Member

Groups: Member
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?
Dmitry  
#13 Posted : Thursday, January 11, 2007 12:46:35 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
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.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Similar Topics
Rounded square/rectangle with drop shadow (Other Products)
by SSR 11/11/2005 5:33:46 PM(UTC)
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.