Re: GDI Plus library

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks Matt!

Your version gave me a machine-level exception on the c_func call but I switched back to using a plain integer for the count and it works now. Thanks much!

Here is my working version if anyone else cares:

global procedure DrawLinePolygon(atom p_graphics,atom p_pen, sequence points ) 
	-- points is a 1-dimensional sequence in the form of {x1,y1,x2,y2,x3,y3...} 
	atom status, p_points 
	integer count 
	sequence floats 
 
	count = length(points)-- count is the number of x and y values 
	p_points = allocate( (count)*4 )-- allocate 4 bytes per integer 
 
	floats = {} 
	for i = 1 to count do 
		floats &= atom_to_float32( points[i] ) 
	end for 
	poke( p_points , floats ) 
 
	--(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,INT count) 
	if gdiplus>0 then 
		status = c_func(xGdipDrawPolygon,{p_graphics, p_pen, p_points, count}) 
	end if 
 
	--puts(1, GetErrorString(status) & "\t" & sprint(points) & "\n" ) 
	free( p_points ) 
end procedure 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu