Forums

Welcome Guest Search | Active Topics | Members

Draw text on a loaded image Options
Michel
Posted: Tuesday, May 03, 2005 2:51:00 AM
Rank: Member
Groups: Member

Joined: 4/25/2005
Posts: 15
Points: 0
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
Dmitry
Posted: Tuesday, May 03, 2005 10:24:00 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 506
Points: 348
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)



Sincerely yours,
Dmitry Sevostjanov.
Michel
Posted: Wednesday, May 04, 2005 1:02:00 AM
Rank: Member
Groups: Member

Joined: 4/25/2005
Posts: 15
Points: 0
thank you !! ^_^

michel
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.