Rank: Member
Groups: Member
Joined: 11/24/2004(UTC) Posts: 5
|
Hi, I am getting an error while trying to draw a rectangle on the PNG image file. The error is as follows. ErroNumber : -22 Descriptiob : Method DrawRectangle failed. Cannot use Graphics with indexed bitmaps The error is raised when i am trying to draw a rectangle on the image. I am not saying its the problem with the PNG file as i am able to draw rectangles on other PNG IMAGES,. but a specdific file is raising the above error when trying to draw a rectangle on the image. Will you please tell me whats going wrong here. What are these Indexed Bitmaps and whether the graphics Mill supports it or not. THanks in Advance Ran1jeet
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
Indexed bitmaps are 1-bit, 4-bit, or 8-bit bitmaps that stores each pixel as an index in the palette which contains actual colors (unlike common pixels like 24-bit RGB, which stores color values theirselves). Such kind of color storage brings some limitations, including possibility to draw at such kind of bitmaps. So to draw a rectangle at indexed image, you should convert the bitmap to another pixel format, e.g. 24-bit RGB: objBitmap.Data.ConvertTo24bppRgb For more detailed explanations what are indexed and other pixel formats read in Color Depth topic. Hope this helps. P.S. Upcoming Graphics Mill 3.0 for .NET can draw at indexed bitmaps without conversion to non-indexed pixel format. Edited by user Tuesday, December 15, 2009 10:28:34 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 11/24/2004(UTC) Posts: 5
|
Hi Andrew, I am now able to draw the rectangles after converting the bitmaps to 24RGB. I am really Thankful for your help. One suggestion for Aurigma Forum I feel that the response time should be faster than it is now. Regards, Ranjith
|
|
|
|
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.