Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I get an API that puts pixel image data in the following interface. Now I have to implement its body of content.

C#
getImageData(
	int nDimX,		// x-dimension of data field
	int nDimY,		// y-dimension of data field
	double	*dpData,	// image data field

	double	dXStart,	// x-coordinate of center of first pixel
	double	dXEnd,		// x-coordinate of center of last pixel
	double	dYStart,	// y-coordinate of center of first pixel
	double	dYEnd)		// y-coordinate of center of last pixel


I try to cope with it; unfortunately, there are not so much information about the API. Only I know the *dpData is stored line wise. x0x0, x1y0, … x0y1, x1y1. and the data is mirrored at the x axis.

I don't have experience in image process programming. does anyone have sample code or suggested library to use to handle the image? thanks for your help!
Posted

1 solution

it depends on what system for are working on Windows you best use bitmaps and the GDI.

My favourite articel CXImage about working with bitmaps.

To set a pixel you can use the SetPixel after loading it in a DC. Adavanced is directly access the memory of the bitmap.
 
Share this answer
 
Comments
Member 11360950 8-Jan-15 6:08am    
Hello, KarstenK:

thanks for your reply. do you think my API interface is enough to construct an image? would you please provide me some sample code to operate *dpData?
Member 11360950 8-Jan-15 6:10am    
Btw, I'm using C#. I'm not sure if System.Drawing is good enough to handle the API

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900