How do you use the GDI+ commands in EBASIC.  Below is a program that I tried (based on something ficko placed on the forum I think).  It doesn't generate any errors, but it doesn't do anything either.  Can someone give me some help?
Thanks,
Clint
$INCLUDE "windowssdk.inc"
$INCLUDE "gdiplus.inc"
GdiPlusStartupInput GDI_Start
UINT GDI_Token
WINDOW w
INT hdc,gdi_ret
OPENWINDOW w,0,0,1024,768,@MINBOX|@MAXBOX|@SIZE|@MAXIMIZED,0,"GDI Test",&main
STARTTIMER w,500
run=1
WAITUNTIL run=0
CLOSEWINDOW w
END
SUB main
	SELECT @MESSAGE
		CASE @IDCREATE
			CENTERWINDOW w
			GDI_Start.GdiPlusVersion=1
			gdi_ret = GdiPlusStartup(&GDI_Token,&GDI_Start,NULL)
		CASE @IDCLOSEWINDOW
			GdiPlusShutdown(GDI_Token)
			run=0
		CASE @IDTIMER
			UINT pPen,pGraphics
			STRING Buffer
			STOPTIMER w
			hdc = GETHDC(w)
			IF gdi_ret=0
				GdipCreateFromHDC(hdc, pGraphics)
				'The color is ARGB
				'UnitPixel,SmoothingModeAntiAlias are enums
				'See "GdiPlusEnums.inc"
				GdipCreatePen1(0xFF000000,1,UnitPixel,pPen)
				GdipSetSmoothingMode(pGraphics,SmoothingModeAntiAlias)
				FOR A = 1 TO 300 STEP 10
					GdipDrawLineI(pGraphics,pPen,A,300,450,300 - A)
					GdipDrawLineI(pGraphics,pPen,450,300 - A,900 - A,300)
					GdipDrawLineI(pGraphics,pPen,A,300,450,300 + A)
					GdipDrawLineI(pGraphics,pPen,450,300 + A,900 - A,300)	
				NEXT A
				GdipDeletePen(pPen)
				GdipDeleteGraphics(pGraphics)
	
			ELSE
				FormatMessage(0x1000, 0, GetLastError(), 0, Buffer, 254, 0)
				MESSAGEBOX 0,Buffer,"GDI ERROR"
			ENDIF
			RELEASEHDC w,hdc
	ENDSELECT
ENDSUB
			
			
			
				This version works
LarryMc
$INCLUDE "windowssdk.inc"
$INCLUDE "gdiplus.inc"
GdiPlusStartupInput GDI_Start
UINT GDI_Token
WINDOW w
INT hdc,gdi_ret
OPENWINDOW w,0,0,1024,768,@MINBOX|@MAXBOX|@SIZE|@MAXIMIZED|@noautodraw,0,"GDI Test",&main
STARTTIMER w,500
run=1
WAITUNTIL run=0
CLOSEWINDOW w
END
SUB main
	SELECT @MESSAGE
		CASE @IDCREATE
			CENTERWINDOW w
			GDI_Start.GdiPlusVersion=1
			gdi_ret = GdiPlusStartup(&GDI_Token,&GDI_Start,NULL)
		CASE @IDCLOSEWINDOW
			GdiPlusShutdown(GDI_Token)
			run=0
		CASE @IDTIMER
			'pointer pPen=0,pGraphics=0
			'STRING Buffer
			STOPTIMER w
      case WM_PAINT
			pointer pPen=0,pGraphics=0
			STRING Buffer
			hdc = GETHDC(w)
			IF gdi_ret=0
				GdipCreateFromHDC(hdc, &pGraphics)
				'The color is ARGB
				'UnitPixel,SmoothingModeAntiAlias are enums
				'See "GdiPlusEnums.inc"
				GdipCreatePen1(0xFF000000,1,UnitPixel,&pPen)
				GdipSetSmoothingMode(&pGraphics,SmoothingModeAntiAlias)
				FOR A = 1 TO 300 STEP 10
					GdipDrawLineI(pGraphics,pPen,A,300,450,300 - A)
					GdipDrawLineI(pGraphics,pPen,450,300 - A,900 - A,300)
					GdipDrawLineI(pGraphics,pPen,A,300,450,300 + A)
					GdipDrawLineI(pGraphics,pPen,450,300 + A,900 - A,300)	
				NEXT A
				IF pPen THEN GdipDeletePen(pPen)
				IF pGraphics then GdipDeleteGraphics(pGraphics) :pGraphics=0
	
			ELSE
				FormatMessage(0x1000, 0, GetLastError(), 0, Buffer, 254, 0)
				MESSAGEBOX 0,Buffer,"GDI ERROR"
			ENDIF
			RELEASEHDC w,hdc
			return 0
	ENDSELECT
ENDSUB
			
			
			
				Thanks, Larry.  I copied and it drew lines like it should, except they didn't look smooth.  Am I missing something?
Later,
Clint
			
			
			
				Found it. This line: GdipSetSmoothingMode(&pGraphics,SmoothingModeAntiAlias)
needs to be this: GdipSetSmoothingMode(pGraphics,SmoothingModeAntiAlias)
GdipSetSmoothingMode needs to send the value, not the pointer.
Later,
Clint
			
			
			
				Here is my preferred method of doing this.  My style of programming.  ;D
You need to clear your graphics with GdipGraphicsClear(pGraphics,color) function before drawing to it.  Otherwise when the screen is resized the smoothing is removed.  Clearing the screen to your background color and then drawing on that takes care of the resize problem.
Later,
Clint
$INCLUDE "windowssdk.inc"
$INCLUDE "gdiplus.inc"
GdiPlusStartupInput GDI_Start
UINT GDI_Token
WINDOW w
INT hdc,gdi_ret
OPENWINDOW w,0,0,640,480,@MINBOX|@MAXBOX|@SIZE|@MAXIMIZED,0,"GDI Test",&main
RedrawScreen()
run=1
WAITUNTIL run=0
CLOSEWINDOW w
END
SUB main
	SELECT @MESSAGE
		CASE @IDCREATE
			CENTERWINDOW w
			GDI_Start.GdiPlusVersion=1
			gdi_ret = GdiPlusStartup(&GDI_Token,&GDI_Start,NULL)
		CASE @IDCLOSEWINDOW
			GdiPlusShutdown(GDI_Token)
			run=0
		CASE @IDSIZECHANGED
			RedrawScreen()
	ENDSELECT
ENDSUB
SUB RedrawScreen()
	pointer pPen=0,pGraphics=0
	STRING Buffer
	hdc = GETHDC(w)
	IF gdi_ret=0
		GdipCreateFromHDC(hdc, &pGraphics)
		'clear the screen
		GdipGraphicsClear(pGraphics,RGBA(255,255,255,255))
		GdipCreatePen1(RGBA(0,0,0,255),1,UnitPixel,&pPen)
		GdipSetSmoothingMode(pGraphics,SmoothingModeAntiAlias)
		FOR A = 1 TO 300 STEP 10
			GdipDrawLineI(pGraphics,pPen,A,300,450,300 - A)
			GdipDrawLineI(pGraphics,pPen,450,300 - A,900 - A,300)
			GdipDrawLineI(pGraphics,pPen,A,300,450,300 + A)
			GdipDrawLineI(pGraphics,pPen,450,300 + A,900 - A,300)	
		NEXT A
		IF pPen THEN GdipDeletePen(pPen)
		IF pGraphics then GdipDeleteGraphics(pGraphics) :pGraphics=0
	ELSE
		FormatMessage(0x1000, 0, GetLastError(), 0, Buffer, 254, 0)
		MESSAGEBOX 0,Buffer,"GDI ERROR"
	ENDIF
	RELEASEHDC w,hdc
ENDSUB
			
			
			
				The code below uses simple caching to increase window resizing performance (more memory = faster)
$INCLUDE "windowssdk.inc"
$INCLUDE "gdiplus.inc"
GdiPlusStartupInput GDI_Start
UINT GDI_Token
WINDOW w
INT gdi_ret
HDC g_hdcCache
OPENWINDOW w,0,0,640,480,@MINBOX|@MAXBOX|@SIZE|@MAXIMIZED,0,"GDI Test",&main
RedrawScreen()
run=1
WAITUNTIL run=0
CLOSEWINDOW w
DeleteDC(g_hdcCache)
END
SUB main
	SELECT @MESSAGE
		CASE @IDCREATE
			CENTERWINDOW w
			GDI_Start.GdiPlusVersion=1
			gdi_ret = GdiPlusStartup(&GDI_Token, &GDI_Start, NULL)
		CASE @IDCLOSEWINDOW
			GdiPlusShutdown(GDI_Token)
			run=0
		CASE @IDSIZECHANGED
			RedrawScreen()
	ENDSELECT
ENDSUB
SUB RedrawScreen(opt BOOL force=false)
	pointer pPen=0,pGraphics=0
	'STRING Buffer
	if (!g_hdcCache)
		HDC hdcdesk = GetDC(0)
		g_hdcCache = CreateCompatibleDC(hdcdesk)
		int screenX = GetSystemMetrics(SM_CXSCREEN)
		int screenY = GetSystemMetrics(SM_CYSCREEN)
		DeleteObject(SelectObject(g_hdcCache, CreateCompatibleBitmap(hdcdesk, screenX, screenY)))
		force = true
	endif
	if (!gdi_ret and force)
		GdipCreateFromHDC(g_hdcCache, &pGraphics)
		'clear the screen
		GdipGraphicsClear(pGraphics,RGBA(255,255,255,255))
		GdipCreatePen1(RGBA(0,0,0,255),1,UnitPixel,&pPen)
		GdipSetSmoothingMode(pGraphics,SmoothingModeAntiAlias)
		FOR A = 1 TO 300 STEP 10
			GdipDrawLineI(pGraphics,pPen,A,300,450,300 - A)
			GdipDrawLineI(pGraphics,pPen,450,300 - A,900 - A,300)
			GdipDrawLineI(pGraphics,pPen,A,300,450,300 + A)
			GdipDrawLineI(pGraphics,pPen,450,300 + A,900 - A,300)	
		NEXT A
		IF pPen THEN GdipDeletePen(pPen)
		IF pGraphics then GdipDeleteGraphics(pGraphics)
	ELSE if (gdi_ret)
		' FormatMessage does not support gdiplus error codes (see Status enumeration in GdiplusTypes.inc)
		'FormatMessage(0x1000, 0, GetLastError(), 0, Buffer, 254, 0)
		MESSAGEBOX 0,"GDI ERROR", *<string>(pPen&0)
	ENDIF
	' copy to window
	HDC hdcWindow = GetHDC(w)
	WINRECT rc
	GetClientRect(w.hwnd, &rc)
	BitBlt(hdcWindow, 0, 0, rc.right, rc.bottom, g_hdcCache, 0,0, SRCCOPY)
	RELEASEHDC w,hdcWindow
ENDSUB
			
			
			
				sapero,
Thanks for your help.  It is always appreciated.
Later,
Clint