ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you display a bmp using the AcGiGeometry::image method?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Darcy.Detlor
865 Views, 2 Replies

How do you display a bmp using the AcGiGeometry::image method?

Does anyone know what format the imageSource needs to be in? The AcGiImageBGRA32 takes a pointer to a AcGiPixelBGRA32, I'm assuming this is an array of the pixels. Is it in a top-down layout or bottom-down? I'm also assuming from the BGRA designation that the colors of each pixel are reversed from that of a bmp. Thanks for looking at this, the SDK had little to say and I didn't see anything on the forum or with Google.
2 REPLIES 2
Message 2 of 3
Balaji_Ram
in reply to: Darcy.Detlor

Hi Darcy,

 

Here is a sample code snippet to explain this :

 

AcGiImageBGRA32 giImage;

AcGiPixelBGRA32 *pixels = new AcGiPixelBGRA32[ImageWidth * ImageHeight];

for (int i = 0; i < ImageWidth; i++)
{
	for (int j=0; j < ImageHeight; j++)
	{
		pixels[(j * ImageWidth) + i].setBGRA(blue, green, red, alpha);
	}
}

giImage.setImage(ImageWidth, ImageHeight, pixels);

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
BigBadBernie
in reply to: Balaji_Ram

What happens to the new AcGiPixelBGRA32 Array?

When I create it in Line:

AcGiPixelBGRA32 *pixels = new AcGiPixelBGRA32[ImageWidth * ImageHeight];

I have to delete it at some point.

When I do this, then AutoCAD crashes.

What is wrong?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost