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

Notification

Icon
Error

Options
Go to last post Go to first unread
ran1jeet  
#1 Posted : Wednesday, November 24, 2004 3:53:00 PM(UTC)
ran1jeet

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
Andrew  
#2 Posted : Sunday, November 28, 2004 2:38:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 866

Thanks: 2 times
Was thanked: 26 time(s) in 26 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

ran1jeet  
#3 Posted : Sunday, November 28, 2004 2:52:00 PM(UTC)
ran1jeet

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
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.