I didn't found solution yet, but:
1. When I used Rathi's DrawGraph function in the loop, saving image to file without displaying it, after 23 regenerations images were incorrect.
Code: Select all
Function Main
local i
private hBitMap
MsgInfo('Start')
for i:=1 to 1000
cfile :='images\im_'+strzero(i,4)+'.bmp'
// first parameter for graph type, second image filename
drawgraph(i%3 +1, cFile)
next i
msgStop('Images generated')
quit
return
Code: Select all
FUNCTION Proc_Create_Logo
LOCAL hDC, BTstruct
LOCAL hBitmap, hBitmap_aux
LOCAL aRGBcolor := {153,217,234}
// Create bitmap in memory
hBitmap := BT_BitmapCreateNew (150, 100, aRGBcolor)
// Create hDC to a bitmap
hDC := BT_CreateDC (hBitmap, BT_HDC_BITMAP, @BTstruct)
// Paint Gradient
BT_DrawGradientFillVertical (hDC, 0, 0, 150, 100, aRGBcolor, BLACK)
// Draw Text
nTypeText := BT_TEXT_TRANSPARENT + BT_TEXT_BOLD
nAlingText := BT_TEXT_LEFT + BT_TEXT_TOP
nOrientation := BT_TEXT_NORMAL_ORIENTATION
BT_DrawText (hDC, 10, 20, "HMG Casino", "Times New Roman", 14, BLACK, WHITE, nTypeText, nAlingText, nOrientation)
// Draw Rectangle
BT_DrawRectangle (hDC, 5, 5, 140, 90, BLUE, 2)
// Paste image
// hBitmap_aux := BT_BitmapLoadFile ("img.png") // load from disk
hBitmap_aux := BT_BitmapLoadFile ("imgPNG") // load from resource
BT_DrawBitmapTransparent (hDC, 30, 30, 100, 100, BT_SCALE, hBitmap_aux, NIL)
BT_BitmapRelease (hBitmap_aux)
// Release hDC bitmap
BT_DeleteDC (BTstruct)
Return hBitmap
Code: Select all
for i:=1 to 1000
cfile :='images\im_'+strzero(i,4)+'.bmp'
hBitmap := Proc_Create_Logo ()
BT_BitmapSaveFile (hBitmap, cfile)
next i
Something is wrong with code generating bars, I think