Oxygen Basic
Programming => Bugs & Feature Requests => Topic started by: Peter on April 06, 2016, 04:51:20 AM
-
Hello Mister Pegge,
before you continue, your latest oxygen.dll has a bug.
take a look below at "stray comma.jpg"
include "gdip.inc"
window 640,480,1
hdc = GetBufferDC()
%UnitPixel = 2
%UnitPoint = 3
Type RectF
single x
single y
single w
single h
End Type
Extern Lib "gdiplus.dll"
! GdipCreateFontFamilyFromName
! GdipDeleteFontFamily
! GdipCreateSolidFill
! GdipDrawString
! GdipCreateFont
! GdipDeleteFont
! GdipDeleteBrush
End Extern
wstring font
Sub SetFontEx(wstring fontname)
font = fontname
end sub
Sub DrawString(single x, y, height, wstring txt)
RECTF fRect = {x, y, ScrW, ScrH} '<< here is the wrongdoer
sys pFont, pFontFamily, pBrush
GdipCreateFontFamilyFromName font, NULL, &pFontFamily
GdipCreateFont pFontFamily, height, FontStyleRegular, UnitPoint, &pFont
GdipCreateSolidFill 0xFFFFFFFF, &pBrush
GdipDrawString hdc, txt, Len(txt), pFont, fRect, NULL, pBrush
GdipDeleteFont pFont
GdipDeleteBrush pBrush
GdipDeleteFontFamily pFontFamily
End Sub
SetFontEx "david"
DrawString 100,100,24,"Hello GdiPlus World"
SetFontEx "georgia"
DrawString 100,124,24,"Hello GdiPlus World"
SetFontEx "gisha"
DrawString 100,158,24,"Hello GdiPlus World"
SetFontEx "impact"
DrawString 100,186,24,"Hello GdiPlus World"
setfontEx "wingdings"
DrawString 100,300,24,"OOOOOOOOOOOO"
DrawString 100,330,24,"XXXXXXXXXXXXXXX"
for i=0 to 640 step 40
DrawString i,0x0,24,"a"
DrawString i,430,24,"b"
next
waitkey
winEnd
.
-
Hallo Peter,
"stray comma:" means: there is an error in your code. I get this message often with my code. I did these changes:
Sub DrawString(single x, y, height, wstring txt) ' what is the purpose of height?
w=Scrw() : h=ScrH()
RECTF fRect = {x, y, w, h} '<< here is the wrongdoer
...
Did you expect this output?
Roland
.
-
Hi Roland,
use oxygen.dll, april o5.2o16!
older dll's work.
-
Using Oxygen.dll with version A41 24/04/2015 I can confirm that the program will run. Yet some other things will not work correctly with this version. I do not know when the behaviour changed. But using Oxygen.dll with version A41 08/06/2015 will show the error message.
Roland
-
The bug appears to affect calls to declared functions (usually library functions) within a multi-assign.
I will need sleep to discover the source and the remedy !
-
Hi Peter,
Fixed.
Oxygen DLL Update (200k) 8 April 2016
http://www.oxygenbasic.org/o2zips/Oxygen.zip