Rank: Member
Groups: Guest
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
|
|
|
|
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 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 |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/24/2005(UTC) Posts: 15
|
|
|
|
|
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.