nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: What's wrong with GdBitmap?
From: tuan
Date: Mon, 09 Oct 2000 12:18:49 -0700

Hi All,


I did the following that try to draw an bitmap that was create in the
new buffer, but my bit map draw on the screen was not correct. What's
wrong? Is the way that I use GdBitmap is corrected.

Tuan


	MWIMAGEBITS  *hbitmap;
	int nWidth, nHeight;
	int size, linelen;
	nWidth = 200;
	nHeight = 200;
	GdFillRect(psd,0,0,500,500);
	PSD newPSD = psd->AllocateMemGC(psd);
	GdCalcMemGCAlloc(psd, nWidth, nHeight, 1, 2, &size, &linelen);
	hbitmap = new MWIMAGEBITS[size];
	MWBOOL result = psd->MapMemGC(newPSD,200,200,1,2,linelen , size
,hbitmap);

        GdSetForeground(blue);
        GdEllipse(newPSD,50,50,50,50, TRUE);

        GdLine(newPSD, 0, 0, 100,100, TRUE);
	GdBitmap(psd,100,100,200, 200,hbitmap) ;

nanogui@linuxhacker.org