Re: win32lib help: Error code 436: getrect:getObject for bitmap failed.

new topic     » goto parent     » topic index » view thread      » older message » newer message
CChris said...

Something is weird about the bmp_snowflake variable.

...

CChris

Thanks for your reply, CChris. I tried that, even eliminating all pixmaps except for the one from the xpmToPixmap call (because it's the only 'bitBlt'able xpmTo function) and I even commented out the copyBlt call that draws bmp_snowflake to the offscreen buffer, and I still got the error. It seems to be happening in this part of the code, specifically during the bitBlt call:

tpc_handle = create_pixmap_pixel(temp_pixel_color[i]) 
bitBlt(bmp_saved, flakes[i][1], flakes[i][2], tpc_handle, 0, 0, 1, 1, SRCCOPY)	-- replace pixel 

which makes me think that it is something similar to what you proposed the problem might be. Could it be that I shouldn't be 'bitBlt'ing a pixmap onto an offscreen bitmap? It seems like these should be compatible because the Euphoria manual says that a pixmap is an "offscreen color bitmap". It could possibly have something to do with the return value from this function, although when I screened the output everything looked legit:

function create_pixmap_pixel(integer color) 
	sequence xpm 
	sequence rgb_seq 
	printf(1, "%d\n", color) 
	rgb_seq = split_rgb(color) 
	xpm = {"1 1 1 1", 
	      sprintf("t c #%02x%02x%02x", {rgb_seq[1], rgb_seq[2], rgb_seq[3]}), 
	      "t"} 
	return xpmToPixmap(xpm) 
end function 

Another thing that may be of note is that whenever the problematic bitBlt line is executed, the program memory used jumps about 40k, which is weird because writing to the offscreen bitmap of a fixed size and dimensions shouldn't consistently be raising memory like that, right? Anyway, if you have any other ideas, please let me know :)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu