pixmap trouble...

BlitzMax Forums/BlitzMax Beginners Area/pixmap trouble...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I do something similar here
Might be because psize isn't big enough? This seems to work...
Graphics 640,480


Global load_image:TPixmap=LoadPixmap("max.png")
If load_image.format<>PF_RGBA8888 Then load_image=ConvertPixmap( load_image,PF_RGBA8888 )

Copy(load_image)


Flip
WaitKey
End


Function Copy(pix:TPixmap)
Local pix_dest:TPixmap=CreatePixmap(pix.width,pix.height,PF_RGBA8888)
Local psource:byte Ptr
Local pdest:byte Ptr
psize=32*4*pix.height*4
For k=0 To pix.width-32 Step 32
		psource=PixmapPixelPtr(pix,k,0)
		pdest=PixmapPixelPtr(pix_Dest,k,0)
		MemCopy(pdest,psource,psize)

Next

image:TImage=LoadImage(pix_DEST)
DrawImage IMAGE,0,0
End Function