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

Notification

Icon
Error

Options
Go to last post Go to first unread
Michel  
#1 Posted : Monday, May 02, 2005 6:51:00 PM(UTC)
Michel

Rank: Member

Groups: Member
Joined: 4/24/2005(UTC)
Posts: 15

Hello, I want to draw text on a loaded image but I don't manage. The first problem I had was the incompatibility between the PixelFormat. The error was :
Code:
Détails de l'exception: Aurigma.GraphicsMill.UnsupportedPixelFormatException: The specified pixel format is not supported.
And the code :
Code:
Dim stream As New System.IO.MemoryStream(image)
Dim bitmap As New Aurigma.GraphicsMill.Bitmap(stream)
Dim bitmapText As New Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.White, Bitmap.Width, Bitmap.Height, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb)
with image : binary data So, I employed BitsPerPixel, IsRGB, HasAlpha and IsIndexed methods to have the correct PixelFormat of my bitmap. I got : bitmap.BitsPerPixel : 8 bitmap.IsRGb : True bitmap.HasAlpha : True bitmap.IsIndexed : True Then, I replaced "Format24bppRgb" by "Format8bppIndexed" and another error came to visit me : Détails de l'exception: System.ArgumentException: Argument has an unappropriate value (CombineMode). (Between two indexed images only CombineModeCopy could be specifyed.). So, I replaced "Aurigma.GraphicsMill.Transforms.CombineMode.Alpha" by "Aurigma.GraphicsMill.Transforms.CombineMode.Copy" in the Draw method and the result is a black image. Can anyone help me? I don't know how to solve it. :'( :'( Thank you very much, Michel

Edited by user Monday, December 24, 2007 3:25:51 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Tuesday, May 03, 2005 2:24:00 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 understood, you load indexed bitmap from stream in the following code snippet:
Code:
Dim stream As New System.IO.MemoryStream(image) 
Dim bitmap As New Aurigma.GraphicsMill.Bitmap(stream) 
and then you try to use CombineMode.Alpha. Graphics Mill for .NET doesn't support this combine mode along with indexed pixel formats, so you should convert the pixel format of loaded image to Rgb24:
Code:
bitmap.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Rgb, False, False)

Edited by user Monday, December 24, 2007 3:26:06 PM(UTC)  | Reason: Not specified

Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
Michel  
#3 Posted : Tuesday, May 03, 2005 5:02:00 PM(UTC)
Michel

Rank: Member

Groups: Member
Joined: 4/24/2005(UTC)
Posts: 15

thank you !! ^_^ michel
Users browsing this topic
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.