Oxygen Basic
Programming => Problems & Solutions => Topic started by: Peter on June 11, 2012, 11:31:43 AM
-
Deleted
-
Hi Peter,
If your prototype is correct then give it the string directly. GDI+ likes to receive a wstring or wchar*
wstring txt="Hello"
status = call GdipDrawString bHdc, txt, Len(txt), Font, tRect, 0, Brush
http://www.jose.it-berater.org/smfforum/index.php?topic=1826.0
Charles
-
Are you doing your low-level call stuff, Peter?
@trect
-
And @tREct crashed.
-
Hi Peter,
From projects/GDIWindow/WaterFallJpg2.o2bas
extern library "gdiplus.dll"
'
long GdiplusStartup( dword *token, GdiplusStartupInput*input, GdiplusStartupOutput *output)
long GdiplusShutdown(dword*token)
long GdipLoadImageFromFile(wstring filename, sys*image)
long GdipCreateBitmapFromFile(wstring filename, sys*bitmap)
long GdipCreateHBITMAPFromBitmap(sys bitmap, sys*hbmReturn, dword backgroundColor)
long GdipDisposeImage(sys image)
'
long GdipCreateFromHDC( sys hdc, *pGraphics)
long GdipGraphicsClear(sys graphics,argb)
long GdipDeleteGraphics(sys graphics)
'
long GdipBitmapGetPixel (sys image,x,y,*argb)
long GdipBitmapSetPixel (sys image,x,y,argb)
long GdipDrawImageRectI(sys graphics,image,x,y,w,h)
long GdipCloneBitmapAreaI(sys x,y,width,height,PixelFormat,srcBitmap,dstBitmap)
'
long GdipCreateSolidFill(sys argb, *brush)
long GdipSetSolidFillColor(sys brush, argb)
long GdipGetSolidFillColor(sys brush, *argb)
long GdipDeleteBrush(delete brush)
long GdipCreatePen1(sys argb, single width, GpUnit unit, sys *pen)
long GdipCreatePen2(sys brush, single width, GpUnit unit,sys *pen)
long GdipGetPenWidth(sys pen, single width)
long GdipSetPenColor(sys pen,argb)
long GdipDeletePen(sys pen)
'
long GdipDrawLineI(sys graphics, pen,x1,y1,x2,y2)
long GdipDrawRectangleI(sys graphics, GpPen pen, x, y,width,height)
long GdipDrawEllipseI(sys graphics, pen,x,y,width,height)
long GdipFillRectangleI(sys graphics,brush,x,y,width,height)
long GdipFillEllipseI(sys graphics,brush,x,y,width,height)
'
long GdipNewInstalledFontCollection(sys * fontCollection);
long GdipCreateFontFamilyFromName(wstring name,sys fontCollection,*FontFamily)
long GdipDeleteFontFamily(sys FontFamily)
long GdipCreateFont(sys fontFamily,single emSize,GpFontStyle style,GpUnit unit,sys *font)
long GdipDeleteFont(sys font)[/b]
'
long GdipDrawString(sys graphics,wstring ws,sys length,font,RECTF *layoutRect,sys stringFormat,brush)
'
end extern
pointf is a floating point rect
all strings must be wide ie: wstring or wchar*
type RECTF single x,y,w,h
GdipDrawString pGraphics,wtxt,-1,font,pointf,0,FontBrush
Charles
-
Peter,
Could you try reverse-engineering that example to your own requirements. I believe it has most of what you need, and I think it would save you a lot of pain.
It is so much easier to start from a working example.
projects/GDIWindow/WaterFallJpg2.o2bas
Charles
-
I recommend a Siesta, Peter. 8)