أحاول إنشاء محرر لبرنامج الخطوط الخاص بي

[ad_1]

لقد كتبت هذا البرنامج منذ عدة سنوات.

يسمح لك بعمل “صور” قابلة للتطوير بالكامل لأحرف الخطوط.

إنه مكتوب بلغة Free BASIC ..

وبما أن أحرف الخط يمكن أن تختلف في الحجم، لم أتمكن من معرفة كيفية إنشاء محرر لها.

كيف يمكنك قص ولصق ونسخ أسطر النص؟

ما حاولت:

كود المصدر الأساسي المجاني..

  1  #define WIN_INCLUDEALL
  2  #include once "windows.bi"
  3  #include once "win\commdlg.bi"
  4  #include "fbgfx.bi"
  5  
  6  const MENUID_BASE      = 100
  7  enum MENUID_ENUM
  8      MENUID_FILE_CLEAR  = MENUID_BASE
  9      MENUID_FILE_OPEN
 10      MENUID_FILE_SAVE
 11      MENUID_FILE_SAVE_AS_BMP
 12      MENUID_FILE_SAVE_INPUT_AS_BMP
 13      MENUID_FILE_EXIT
 14  '===============================================================================
 15      MENUID_BRUSH_SIZE_0_ZERO
 16      MENUID_BRUSH_SIZE_0_1
 17      MENUID_BRUSH_SIZE_0_2
 18      MENUID_BRUSH_SIZE_0_3
 19      MENUID_BRUSH_SIZE_0_4
 20      MENUID_BRUSH_SIZE_0_5
 21      MENUID_BRUSH_SIZE_0_6
 22      MENUID_BRUSH_SIZE_0_7
 23      MENUID_BRUSH_SIZE_0_8
 24      MENUID_BRUSH_SIZE_0_9
 25  '===============================================================================
 26      MENUID_BRUSH_SIZE_ZERO_0
 27      MENUID_BRUSH_SIZE_1_0
 28      MENUID_BRUSH_SIZE_2_0
 29      MENUID_BRUSH_SIZE_3_0
 30      MENUID_BRUSH_SIZE_4_0
 31      MENUID_BRUSH_SIZE_5_0
 32      MENUID_BRUSH_SIZE_6_0
 33      MENUID_BRUSH_SIZE_7_0
 34      MENUID_BRUSH_SIZE_8_0
 35      MENUID_BRUSH_SIZE_9_0
 36  '===============================================================================
 37      MENUID_GLYPH_X_4 
 38      MENUID_GLYPH_X_8 
 39      MENUID_GLYPH_X_10
 40      MENUID_GLYPH_X_12
 41      MENUID_GLYPH_X_14
 42      MENUID_GLYPH_X_16
 43      MENUID_GLYPH_X_18
 44      MENUID_GLYPH_X_20
 45      MENUID_GLYPH_X_22
 46      MENUID_GLYPH_X_24
 47      MENUID_GLYPH_X_26
 48      MENUID_GLYPH_X_28
 49      MENUID_GLYPH_X_30
 50      MENUID_GLYPH_X_32
 51      MENUID_GLYPH_X_48
 52      MENUID_GLYPH_X_64
 53  '===============================================================================
 54      MENUID_GLYPH_Y_4 
 55      MENUID_GLYPH_Y_8 
 56      MENUID_GLYPH_Y_10
 57      MENUID_GLYPH_Y_12
 58      MENUID_GLYPH_Y_14
 59      MENUID_GLYPH_Y_16
 60      MENUID_GLYPH_Y_18
 61      MENUID_GLYPH_Y_20
 62      MENUID_GLYPH_Y_22
 63      MENUID_GLYPH_Y_24
 64      MENUID_GLYPH_Y_26
 65      MENUID_GLYPH_Y_28
 66      MENUID_GLYPH_Y_30
 67      MENUID_GLYPH_Y_32
 68      MENUID_GLYPH_Y_48
 69      MENUID_GLYPH_Y_64
 70  '===============================================================================
 71      MENUID_RATIO_4
 72      MENUID_RATIO_6
 73      MENUID_RATIO_8
 74      MENUID_RATIO_10
 75  '===============================================================================
 76      MENUID_COLOR_BLACK
 77      MENUID_COLOR_BROWN
 78      MENUID_COLOR_RED
 79      MENUID_COLOR_ORANGE
 80      MENUID_COLOR_YELLOW
 81      MENUID_COLOR_GREEN
 82      MENUID_COLOR_BLUE
 83      MENUID_COLOR_VIOLET
 84      MENUID_COLOR_WHITE
 85      MENUID_COLOR_CUSTOM
 86  '===============================================================================
 87      MENUID_HELP_ABOUT
 88      MAXMENUS
 89  end enum
 90  '===============================================================================
 91  'setup menus
 92  '===============================================================================
 93  type TMENU : hnd as HMENU : end type
 94  dim shared submenuTB(0 to MAXMENUS) as TMENU
 95  dim shared as uinteger menuid
 96  
 97  '===============================================================================
 98  '===============================================================================
 99  'variables
100  '===============================================================================
101  '===============================================================================
102  '===============================================================================
103  dim shared as integer MouseDown
104  dim shared as integer  mouse_x=0
105  dim shared as integer  mouse_y=0
106  dim shared as integer  last_x =0
107  dim shared as integer  last_y =0
108  
109  dim shared as integer  glyph_x    = 32
110  dim shared as integer  glyph_y    = 32
111  dim shared as ulongint b_color    = &H000000
112  dim shared as single   b_size_01  = 0
113  dim shared as single   b_size_10  = 0
114  dim shared as integer  ratio      = 10
115  
116  'dim shared as ulongint bc
117  'dim shared as single bs_10
118  'dim shared as single bs_01
119  
120  'drawing storage strings for saving and loading
121  dim shared as string glyph_size 
122  dim shared as string xpos
123  dim shared as string ypos
124  dim shared as string brush_color
125  dim shared as string brush_size
126  dim shared as string connected
127  
128  'toggle 0/1 for erasing or keeping storage strings
129  dim shared as integer clear_strings=0
130  
131  'file name variables
132  dim shared as string file , ext , filename , File_type
133  
134  'setup handle,messaging,structs
135  Dim shared hWnd As HWND
136  Dim shared msg as MSG
137  dim shared rct as RECT
138  dim shared pnt as PAINTSTRUCT
139  dim shared hDC as HDC
140  
141  'setup glyph-grid objs
142  dim shared Glyph_Grid as HBITMAP
143  dim shared Glyph_Grid_Pen as HPEN
144  dim shared GridDC as HDC
145  dim shared glyphobj as HGDIOBJ
146  dim shared glyphpen_obj as HGDIOBJ
147  
148  'setup font window objs
149  dim shared Font_Grid as HBITMAP
150  dim shared Font_Grid_Pen as HPEN
151  dim shared FontDC as HDC
152  dim shared fontobj as HGDIOBJ
153  dim shared fontpen_obj as HGDIOBJ
154  
155  'setup output window objs
156  dim shared OutPut_Grid as HBITMAP
157  dim shared OutPut_Grid_Pen as HPEN
158  dim shared OutPutDC as hDC
159  dim shared OutPutobj as HGDIOBJ
160  dim shared OutPutpen_obj as HGDIOBJ
161  
162  'setup help text
163  dim shared as string help_text
164          help_text = "Picto-Font Version 9.0 Feb / 2019               " +chr(13)+chr(10)
165          help_text+= "Email: Albert_Redditt@yahoo.com                 " +chr(13)+chr(10)
166          help_text+= "                                                " +chr(13)+chr(10)
167          help_text+= "A Custom Font creation program.                 " +chr(13)+chr(10)
168          help_text+= "Curently there are no editors,                  " +chr(13)+chr(10)
169          help_text+= "for the programs output.                        " +chr(13)+chr(10)
170          help_text+= "                                                " +chr(13)+chr(10)
171          help_text+= "Click on Glyph_X_Size And Glyph_Y_Size          " +chr(13)+chr(10)
172          help_text+= "and select a grid size.                         " +Chr(13)+chr(10)
173          help_text+= "                                                " +chr(13)+chr(10)
174          help_text+= "Click on Ratio to selcet a drawing zoom ratio.  " +chr(13)+chr(10)
175          help_text+= "                                                " +chr(13)+chr(10)
176          help_text+= "Click on File CLEAR_GLYPH to clear the grid.    " +chr(13)+chr(10)
177          help_text+= "                                                " +chr(13)+chr(10)
178          help_text+= "Click on Brush Color to set the brush color     " +chr(13)+chr(10)
179          help_text+= "                                                " +chr(13)+chr(10)
180          help_text+= "Click on Brush Size to set the brush size       " +chr(13)+chr(10)
181          help_text+= "                                                " +chr(13)+chr(10)
182          help_text+= "Right click somewhere on the picture to set     " +chr(13)+chr(10)
183          help_text+= "the initial X/Y position.                       " +chr(13)+chr(10)
184          help_text+= "                                                " +chr(13)+chr(10)
185          help_text+= "Left Click to connect the two points.           " +chr(13)+chr(10)
186          help_text+= "                                                " +chr(13)+chr(10)
187          help_text+= "Hold down a Button while moving to do FreeStyle." +chr(13)+chr(10)
188          help_text+= "                                                " +chr(13)+chr(10)
189          help_text+= "The console screen will display the Bytes used so far."+chr(13)+chr(10)
190  
191  '===============================================================================
192  '===============================================================================
193  'declare subs and functions
194  '===============================================================================
195  '===============================================================================
196  declare sub menu_separator( byval submenu as integer )
197  declare sub menu_append( byval submenu as integer, byval id as integer, byref title as string, byval flags as integer = 0 )
198  declare sub menu_insert( byval hmenu as HMENU, byval submenu as integer, byref title as string, byval flags as integer = 0 )
199  declare sub init_menus( byval hWnd as HWND )
200  
201  declare sub getfilename()
202  
203  declare Sub Load_Font(byval hWnd as HWND , byval rct as RECT)
204  
205  declare sub Create_Glyph_Grid_And_Pen(byval hWnd as HWND)
206  declare sub Make_Grid(byval hWnd as HWND)
207  declare sub Delete_Glyph_Grid_And_Pen(byval hWnd as HWND)
208  
209  declare Sub Create_Font_Grid_And_Pen(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
210  declare sub Delete_Font_Grid_And_Pen(byval hWnd as HWND)
211  
212  declare Sub Create_Output_Grid_And_Pen(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
213  declare sub Delete_OutPut_Grid_And_Pen(byval hWnd as HWND)
214  
215  declare sub Resize_Grids(byval hWnd as HWND)
216  declare Sub Select_Pens(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
217  
218  declare sub Mouse_Update(byval hWnd as HWND , byval mouse as string   , byval mouse_x as integer , byval mouse_y as integer )
219  declare sub Draw_Mouse(byval hWnd as HWND,byval mouse_x as integer,byval mouse_y as integer,byval last_x as integer,byval last_y as integer)
220  
221  declare sub Bit_blt(byval hWnd as HWND)
222  declare sub Update(BYVAL hWnd as HWND , BYVal rct as RECT)
223  declare Sub ReDraw(byval hWnd as HWND , byval rct as RECT)
224  '===============================================================================
225  declare function WndProc ( byval hWnd    as HWND   , _
226                             byval message as UINT   , _
227                             byval wParam  as WPARAM , _
228                             byval lParam  as LPARAM ) as LRESULT
229  '===============================================================================
230  declare function WinMain ( byval hInstance as HINSTANCE     , _
231                             byval hPrevInstance as HINSTANCE , _
232                             byref szCmdLine as string        , _
233                             byval iCmdShow as integer ) as integer
234  end WinMain( GetModuleHandle( null ), null, Command, SW_NORMAL )
235  '===============================================================================
236  '===============================================================================
237  'subs and functions below here
238  '===============================================================================
239  '===============================================================================
240  sub Create_Glyph_Grid_And_Pen(byval hWnd as HWND)
241      dim hdc as HDC
242      Glyph_Grid     = CreateCompatibleBitmap(GetDC(hWnd) , glyph_x*ratio , glyph_y*ratio )
243      Glyph_Grid_Pen = CreatePen(PS_SOLID , 1 ,  &h00cf0000 )
244      GridDC         = CreateCompatibleDC( hDC )
245  	Dim As RECT Glyph_Grid_Rect = ( 0 , 0 , glyph_x*ratio , glyph_y*ratio )
246  	SelectObject GridDC , Glyph_Grid
247  	FillRect .GridDC , @Glyph_Grid_Rect , null
248  end sub
249  '===============================================================================
250  '===============================================================================
251  sub Delete_Glyph_Grid_And_Pen(byval hWnd as HWND)
252      dim hdc as HDC
253      SelectObject( GridDC, glyphobj )
254      SelectObject( GridDC, glyphpen_obj )
255      DeleteObject( Glyph_Grid )
256      DeleteObject( Glyph_Grid_Pen )
257      DeleteDC( GridDC )
258  end sub
259  '===============================================================================
260  '===============================================================================
261  sub Make_Grid(byval hWnd as HWND)
262      dim hdc as HDC
263      glyphobj     = SelectObject( GridDC, Glyph_Grid     )
264      glyphpen_obj = SelectObject( GridDC, Glyph_Grid_Pen )
265      for a as integer     = 0 to glyph_x*ratio step (glyph_x*ratio) / glyph_x
266          for b as integer = 0 to glyph_y*ratio step (glyph_y*ratio) / glyph_y
267              lineto(GridDC,a,b)
268              MoveToEX(GridDC, a +(glyph_x*ratio) / glyph_x , b + (glyph_y*ratio)/glyph_y,0)
269          next
270      next
271  end sub
272  '===============================================================================
273  '===============================================================================
274  Sub Create_Font_Grid_And_Pen(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
275      dim hDC as HDC
276      Font_Grid     = CreateCompatibleBitmap(GetDC(hWnd) , glyph_x*ratio , glyph_y*ratio )
277      Font_Grid_Pen = CreatePen( PS_SOLID , sqr(glyph_x*glyph_y)*(((bs_01*.01)+(bs_10*.1))*ratio ) , bc )
278      FontDC        = CreateCompatibleDC( hDC )
279  	Dim As RECT Font_Grid_Rect = ( 0 , 0 , glyph_x*ratio , glyph_y*ratio )
280  	SelectObject FontDC , Font_Grid
281  	FillRect .FontDC , @Font_Grid_Rect , null
282  	'
283  	fontobj       = SelectObject( FontDC, Font_Grid     )	
284      fontpen_obj   = SelectObject( FontDC, Font_Grid_Pen )
285  end sub
286  '===============================================================================
287  '===============================================================================
288  sub Delete_Font_Grid_And_Pen(byval hWnd as HWND)
289      dim hDC as HDC
290      SelectObject( FontDC, fontobj )
291      SelectObject( FontDC, fontpen_obj )
292      DeleteObject( Font_Grid )
293      DeleteObject( Font_Grid_Pen )
294      DeleteDC( FontDC )
295  end sub
296  '===============================================================================
297  '===============================================================================
298  Sub Create_Output_Grid_And_Pen(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
299      dim hDC as HDC
300      OutPut_Grid     = CreateCompatibleBitmap(GetDC(hWnd), glyph_x , glyph_y )
301      OutPut_Grid_Pen = CreatePen(PS_SOLID,sqr(glyph_x*glyph_y)*(((bs_01*.01)+(bs_10*.1))*1 ),bc)
302      OutPutDC        = CreateCompatibleDC(HDC)
303  	Dim As RECT OutPut_Grid_Rect = ( 0 , 0 , glyph_x*ratio , glyph_y*ratio )
304  	SelectObject OutPutDC , OutPut_Grid
305  	FillRect .OutPutDC , @OutPut_Grid_Rect , null
306      '
307  	outputobj       = SelectObject(OutPutDC , OutPut_Grid     )
308      outputpen_obj   = SelectObject(OutPutDC , OutPut_Grid_Pen )
309  end sub
310  '===============================================================================
311  '===============================================================================
312  sub Delete_Output_Grid_And_Pen(byval hWnd as HWND)
313      dim hDC as HDC
314      SelectObject( OutPutDC, outputobj )
315      SelectObject( OutPutDC, outputpen_obj )
316      DeleteObject( OutPut_Grid )
317      DeleteObject( OutPut_Grid_Pen )
318      DeleteDC( OutPutDC )
319  end sub
320  '===============================================================================
321  '===============================================================================
322  sub Resize_Grids(byval hWnd as HWND)
323      Delete_Glyph_Grid_And_Pen( hWnd )
324      Delete_Font_Grid_And_Pen( hWnd )
325      Delete_OutPut_Grid_And_Pen( hWnd )
326      Create_Glyph_Grid_And_Pen(hWnd) : Make_Grid(hWnd)
327      Create_Font_Grid_And_Pen( hWnd , b_color , b_size_10 , b_size_01)
328      Create_OutPut_Grid_And_Pen( hWnd , b_color , b_size_10 , b_size_01)
329      ReDraw(hWnd,rct)
330  end sub
331  '===============================================================================
332  '===============================================================================
333  Sub Select_Pens(byval hWnd as HWND , byref bc as ulongint , byref bs_10 as single , byref bs_01 as single)
334      Font_Grid_Pen   = CreatePen( PS_SOLID , sqr(glyph_x*glyph_y)*(((bs_01*.01)+(bs_10*.1))*ratio ) , bc )
335      fontpen_obj     = SelectObject( FontDC, Font_Grid_Pen )
336      OutPut_Grid_Pen = CreatePen( PS_SOLID , sqr(glyph_x*glyph_y)*(((bs_01*.01)+(bs_10*.1))*1     ) , bc )
337      outputpen_obj   = SelectObject( OutputDC, OutPut_Grid_Pen )
338  end sub
339  '===============================================================================
340  '===============================================================================
341  'mouse stuff below here
342  '===============================================================================
343  '===============================================================================
344  sub Mouse_Update(byval hWnd as HWND , byval mouse as string , byval mouse_x as integer , byval mouse_y as integer )
345      
346      if mouse_x < 0 or mouse_x > (glyph_x*ratio) then return
347      if mouse_y < 0 or mouse_y > (glyph_y*ratio) then return
348      
349      select case mouse
350          case "l_down" : MouseDown=1
351          case "l_up"   : MouseDown=0
352          Case "r_down" : MouseDown=1 :last_x=mouse_x : last_y=mouse_y
353          case "r_up"   : MouseDown=0 :last_x=mouse_x : last_y=mouse_y
354          Case "move"   : if MouseDown=0 then return
355      end select
356      
357      if MouseDown=1 then
358          glyph_size=right("00"  + str(glyph_x),2) + right("00"+str(glyph_y),2)
359          xpos+ =    right("000" + str(int(100/((glyph_x*ratio/(mouse_x+1))))),3)
360          ypos+ =    right("000" + str(int(100/((glyph_y*ratio/(mouse_y+1))))),3)
361          brush_color+= right("00000000" + str(b_color),8)
362          brush_size += right("0" + str(b_size_10),1) + right("0" + str(b_size_01),1)
363          
364          if mouse_x<>last_x or mouse_y<>last_y then 
365              connected+="1"
366          else
367              connected+="0"
368          end if
369          
370          color 14
371          print string(80,"=");
372          color 7
373          print "Glyph Size   = " ; glyph_size
374          print "X Positions  = " ; xpos
375          print "Y positions  = " ; ypos
376          print "Brush Colors = " ; brush_color
377          print "Brush Sizes  = " ; brush_size
378          print "Draw To      = " ; connected 
379          print "Bytes For CHR= " ; len(glyph_size)+len(xpos)+len(ypos)+len(brush_color)+len(brush_size)+len(connected)
380          color 14
381          print string(80,"=")
382          color 7
383          
384          Draw_Mouse(hWnd, mouse_x , mouse_y, last_x ,last_y)
385          'Bit_blt(hWnd)
386          
387          last_x=mouse_x
388          last_y=mouse_y
389          
390          if mouse="move" then UpDate(hWnd,rct)
391      
392      end if
393  end sub
394  '===============================================================================
395  '===============================================================================
396  sub Draw_Mouse(byval hWnd as HWND,byval mouse_x as integer,byval mouse_y as integer,byval last_x as integer,byval last_y as integer)
397      hDC = BeginPaint( hWnd, @pnt )
398          if mouse_x<>0 and mouse_y<>0 then
399              Select_Pens(hWnd,b_color,b_size_10,b_size_01)
400              'draw the line with the font_pen
401              MoveToEx(FontDC , ( last_x)-1 , ( last_y)-1 , 0)
402                LineTo(FontDC , (mouse_x)-1 , (mouse_y)-1)
403              'draw the line of the output
404              MoveToEx(OutputDC , ( last_x/ratio)-1 , ( last_y/ratio)-1 , 0)
405                LineTo(OutputDC , (mouse_x/ratio)-1 , (mouse_y/ratio)-1)
406          end if
407      EndPaint( hWnd, @pnt )
408  end sub
409  '===============================================================================
410  '===============================================================================
411  'BIT BLT and update below here
412  '===============================================================================
413  '===============================================================================
414  sub Bit_blt(byval hWnd as HWND)
415      dim hDC as HDC
416      hDC = BeginPaint( hWnd, @pnt )
417          'Transfer the GRID
418          BitBlt(hDC , 0 , 0 , glyph_x*ratio , glyph_y*ratio , GridDC , 0 , 0 , SRCCOPY)
419          'Transfer the FONT
420          BitBlt(hDC , 0 , 0 , glyph_x*ratio , glyph_y*ratio , FontDc , 0 , 0 , SRCAND)
421          'Transfer the OUTPUT
422          BitBlt(hDC ,(glyph_x*ratio)+60, 0  , glyph_x  , glyph_y    , OutputDC , 0, 0 , SRCCOPY)
423      EndPaint( hWnd, @pnt )
424  end sub
425  '===============================================================================
426  '===============================================================================
427  sub Update(BYVAL hWnd as HWND , BYVal rct as RECT)
428      InvalidateRect( hwnd, 0, TRUE )
429      UpdateWindow(hWnd)
430  end sub
431  '===============================================================================
432  '===============================================================================
433  'ReDraw() goes through strorage strings and replots the character.
434  '===============================================================================
435  '===============================================================================
436  Sub ReDraw(byval hWnd as HWND , byval rct as RECT)
437      dim hDC as HDC
438      dim as ulongint count_xy
439      dim as ulongint count_color
440      dim as ulongint count_size
441      dim as ulongint count_connected
442      dim as ulongint connect
443      dim as ulongint lx , ly ,mx , my , bc
444      dim as single bs_10 , bs_01
445      
446      count_xy        =1
447      count_color     =1
448      count_size      =1
449      count_connected =2
450      do
451          lx  =  (val(mid( xpos       ,count_xy     +0,3))/100) * (glyph_x*ratio)
452          ly  =  (val(mid( ypos       ,count_xy     +0,3))/100) * (glyph_y*ratio)
453          mx  =  (val(mid( xpos       ,count_xy     +3,3))/100) * (glyph_x*ratio)
454          my  =  (val(mid( ypos       ,count_xy     +3,3))/100) * (glyph_y*ratio)
455          bc =valulng(mid( brush_color,count_color   , 8))
456          bs_10 = val(mid( brush_size ,count_size   +0,1))
457          bs_01 = val(mid( brush_size ,count_size   +1,1))
458          connect=val(mid( connected  ,count_connected,1))
459          
460          Select_Pens(hWnd,bc,bs_10,bs_01)
461          
462          hDC = BeginPaint( hWnd, @pnt )
463              if connect=1 then 'two points are connected    
464                  MoveToEx(FontDC , (lx)-1 , (ly)-1 , 0)
465                    LineTo(FontDC , (mx)-1 , (my)-1)
466                  
467                  MoveToEx(OutPutDC , (lx/ratio)-1 , (ly/ratio)-1 , 0)
468                    LineTo(OutPutDC , (mx/ratio)-1 , (my/ratio)-1)
469              else ' two points are not connected
470                  MoveToEx(FontDC , (lx)-1 , (ly)-1 , 0)
471                    LineTo(FontDC , (lx)-1 , (ly)-1)
472                  
473                  MoveToEx(OutPutDC , (lx/ratio)-1 , (ly/ratio)-1 , 0)
474                    LineTo(OutPutDC , (lx/ratio)-1 , (ly/ratio)-1)
475              end if
476          EndPaint( hWnd, @pnt )
477          
478          count_xy        +=3
479          count_color     +=8
480          count_size      +=2
481          count_connected +=1
482          
483      loop until count_size>=len(brush_size)
484      
485      last_x  = lx
486      last_y  = ly
487      mouse_x = mx
488      mouse_y = my
489      
490      Update(hWnd,rct)
491  end sub
492  '===============================================================================
493  '===============================================================================
494  'File stuff below here
495  '===============================================================================
496  '===============================================================================
497  Sub Load_Font(byval hWnd as HWND , byval rct as RECT)
498      file = ""
499      file_type="pft"
500      getfilename()
501      
502      if file <> "" then
503          open file for input as #1
504              line input #1,glyph_size
505              line input #1,xpos
506              line input #1,ypos
507              line input #1,brush_color
508              line input #1,brush_size
509              line input #1,connected
510          close #1
511          
512          if glyph_x and glyph_y = 0 then
513              glyph_x=val( left(glyph_size,2))
514              glyph_y=val(right(glyph_size,2))
515          end if
516      
517          print "Glyph Size   = " ; glyph_size
518          print "X Positions  = " ; xpos
519          print "Y positions  = " ; ypos
520          print "Brush Colors = " ; brush_color
521          print "Brush Sizes  = " ; brush_size
522          print "Draw To      = " ; connected 
523          print "Bytes For CHR= " ; len(glyph_size)+len(xpos)+len(ypos)+len(brush_color)+len(brush_size)+len(connected)
524          print string(78,"=")
525      
526          Resize_Grids(hWnd)
527      end if
528  end sub
529  '===============================================================================
530  '===============================================================================
531  'wndProcess
532  '===============================================================================
533  '===============================================================================
534  function WndProc ( byval hWnd as HWND, _
535                     byval message as UINT, _
536                     byval wParam as WPARAM, _
537                     byval lParam as LPARAM ) as LRESULT
538  
539      function=0
540      
541      mouse_x = LoWord(LParam)
542      mouse_y = HiWord(LParam)
543      
544      
545      select case( message )
546          '=======================================================================
547          case WM_CREATE
548              init_menus(hWnd)
549              Resize_Grids(hWnd)
550          '=======================================================================
551          case WM_PAINT 
552              bit_blt(hWnd)
553          '=======================================================================
554          case WM_CLOSE
555              Delete_Glyph_Grid_And_Pen( hWnd )
556              Delete_Font_Grid_And_Pen( hWnd )
557              Delete_OutPut_Grid_And_Pen( hWnd )
558              DestroyWindow( hWnd )
559          '=======================================================================
560          case WM_DESTROY
561              Delete_Glyph_Grid_And_Pen( hWnd )
562              Delete_Font_Grid_And_Pen( hWnd )
563              Delete_OutPut_Grid_And_Pen( hWnd )
564              PostQuitMessage( 0 )
565          '=======================================================================
566          Case WM_LBUTTONDOWN : Mouse_Update(hWnd , "l_down" , mouse_x , mouse_y ) : UpDate(hWnd,rct)
567          Case WM_LBUTTONUP   : Mouse_Update(hWnd , "l_up"   , mouse_x , mouse_y ) : UpDate(hWnd,rct)
568          Case WM_RBUTTONDOWN : Mouse_Update(hWnd , "r_down" , mouse_x , mouse_y ) : UpDate(hWnd,rct)
569          Case WM_RBUTTONUP   : Mouse_Update(hWnd , "r_up"   , mouse_x , mouse_y ) : UpDate(hWnd,rct)
570          Case WM_MOUSEMOVE   : Mouse_Update(hWnd , "move"   , mouse_x , mouse_y )
571          '=======================================================================
572          case WM_COMMAND
573              select case loword( wParam )
574                  '===================================================================
575                  case MENUID_FILE_CLEAR
576                      'reset variables to default
577                      glyph_x = glyph_x
578                      glyph_y = glyph_y
579                      mouse_x=0 : mouse_y=0
580                      last_x =0 : last_y =0
581                      'clear the monitor output
582                      cls
583                      'zero our character storage strings
584                      glyph_size=""
585                      xpos=""
586                      ypos=""
587                      brush_color=""
588                      brush_size=""
589                      connected=""
590                      'rebuild the glyphs
591                      Resize_Grids(hWnd)
592                      UpDate(hWnd,rct)
593                  '===============================================================
594                  case MENUID_FILE_OPEN : cls : Load_Font(hWnd,rct)
595                  '===============================================================
596                  case MENUID_FILE_SAVE
597                      file = ""
598                      file_type="pft"
599                      getfilename()
600                      if file <> "" then
601                          open file for output as #1
602                          print #1,glyph_size
603                          print #1,xpos
604                          print #1,ypos
605                          print #1,brush_color
606                          print #1,brush_size
607                          print #1,connected
608                          close #1
609                      end if
610                  '===============================================================
611                  case MENUID_FILE_SAVE_AS_BMP
612                      file = ""
613                      file_type="bmp"
614                      getfilename()
615                      
616                      Dim As Any Ptr MYIMG
617                      Dim As hDC MYDC
618                      Dim As HBitmap MYBMP
619                      Dim As BITMAPINFOHEADER MYBMPINFO
620                      
621                      Dim As Integer sx, sy
622                      Screenres 128,128,32
623                      'Screeninfo sx, sy
624                      sx = glyph_x
625                      sy = glyph_y
626                      MYIMG = ImageCreate(sx, sy)
627                      'TMPWND = GetDesktopWindow()
628                      'GetClientRect(TMPWND, @WNDRECT)
629                      'WNDDC = GetDC(TMPWND)
630                      MYDC = CreateCompatibleDC(OutPutDC) 
631                      MYBMP = CreateCompatibleBitmap(OutputDC, sx, sy)
632                      SelectObject(MYDC, MYBMP) 
633                      
634                      With MYBMPINFO
635                        .biSize = Sizeof(MYBMPINFO)
636                        .biWidth = sx
637                        .biHeight = -sy
638                        .biPlanes = 1
639                        .biBitCount = 32
640                        .biCompression = BI_RGB
641                        .biSizeImage = 0
642                      End With
643                      
644                      BitBlt(MYDC, 0, 0, sx, sy, OutputDC, 0, 0, SRCCOPY)
645                      GetDIBits(MYDC, MYBMP, 0, sy, MYIMG + Sizeof(FB.IMAGE), Cptr(BITMAPINFO Ptr, @MYBMPINFO), DIB_RGB_COLORS)
646                      Put (0, 0), MYIMG, Pset
647                      BSave( file , MYIMG)
648                      screen 0 
649                      'ReleaseDC(TMPWND,WNDDC)
650                      DeleteDC(MYDC)
651                      DeleteObject(MYBMP)
652                      imagedestroy(MYIMG)
653                  '===============================================================
654                  Case MENUID_FILE_SAVE_INPUT_AS_BMP
655                      file = ""
656                      file_type="bmp"
657                      getfilename()
658                      
659                      Dim As Any Ptr MYIMG
660                      Dim As hDC MYDC
661                      Dim As HBitmap MYBMP
662                      Dim As BITMAPINFOHEADER MYBMPINFO
663                      
664                      Dim As Integer sx, sy
665                      Screenres Glyph_x*ratio , glyph_y * ratio, 32
666                      'Screeninfo sx, sy
667                      sx = glyph_x*ratio
668                      sy = glyph_y*ratio
669                      MYIMG = ImageCreate(sx, sy)
670                      'TMPWND = GetDesktopWindow()
671                      'GetClientRect(TMPWND, @WNDRECT)
672                      'WNDDC = GetDC(TMPWND)
673                      MYDC = CreateCompatibleDC(FontDC) 
674                      MYBMP = CreateCompatibleBitmap(FontDC, sx, sy)
675                      SelectObject(MYDC, MYBMP) 
676                      
677                      With MYBMPINFO
678                        .biSize = Sizeof(MYBMPINFO)
679                        .biWidth = sx
680                        .biHeight = -sy
681                        .biPlanes = 1
682                        .biBitCount = 32
683                        .biCompression = BI_RGB
684                        .biSizeImage = 0
685                      End With
686                      
687                      BitBlt(MYDC, 0, 0, sx, sy, FontDC, 0, 0, SRCCOPY)
688                      GetDIBits(MYDC, MYBMP, 0, sy, MYIMG + Sizeof(FB.IMAGE), Cptr(BITMAPINFO Ptr, @MYBMPINFO), DIB_RGB_COLORS)
689                      Put (0, 0), MYIMG, Pset
690                      BSave( file , MYIMG)
691                      screen 0
692                      'ReleaseDC(TMPWND,WNDDC)
693                      DeleteDC(MYDC)
694                      DeleteObject(MYBMP)
695                      imagedestroy(MYIMG)
696                      
697                  '===============================================================
698                  case MENUID_FILE_EXIT 
699                      Delete_Glyph_Grid_And_Pen( hWnd )
700                      Delete_Font_Grid_And_Pen( hWnd )
701                      Delete_OutPut_Grid_And_Pen( hWnd )
702                      PostMessage( hWnd, WM_CLOSE, 0, 0 )
703                  '===============================================================
704                  '===================================================================
705                  'SIZES 1% to 9%
706                  case MENUID_BRUSH_SIZE_0_ZERO : b_size_01=0
707                  case MENUID_BRUSH_SIZE_0_1    : b_size_01=1
708                  case MENUID_BRUSH_SIZE_0_2    : b_size_01=2
709                  case MENUID_BRUSH_SIZE_0_3    : b_size_01=3
710                  case MENUID_BRUSH_SIZE_0_4    : b_size_01=4
711                  case MENUID_BRUSH_SIZE_0_5    : b_size_01=5
712                  case MENUID_BRUSH_SIZE_0_6    : b_size_01=6
713                  case MENUID_BRUSH_SIZE_0_7    : b_size_01=7
714                  case MENUID_BRUSH_SIZE_0_8    : b_size_01=8
715                  case MENUID_BRUSH_SIZE_0_9    : b_size_01=9
716                  '===================================================================
717                  'SIZES 10% to 90%
718                  case MENUID_BRUSH_SIZE_ZERO_0 : b_size_10=0
719                  case MENUID_BRUSH_SIZE_1_0    : b_size_10=1
720                  case MENUID_BRUSH_SIZE_2_0    : b_size_10=2
721                  case MENUID_BRUSH_SIZE_3_0    : b_size_10=3
722                  case MENUID_BRUSH_SIZE_4_0    : b_size_10=4
723                  case MENUID_BRUSH_SIZE_5_0    : b_size_10=5
724                  case MENUID_BRUSH_SIZE_6_0    : b_size_10=6
725                  case MENUID_BRUSH_SIZE_7_0    : b_size_10=7
726                  case MENUID_BRUSH_SIZE_8_0    : b_size_10=8
727                  case MENUID_BRUSH_SIZE_9_0    : b_size_10=9
728                  '===================================================================
729                  'GLYPH_X
730                  Case MENUID_GLYPH_X_4 : glyph_x= 4:Resize_Grids(hWnd)
731                  Case MENUID_GLYPH_X_8 : glyph_x= 8:Resize_Grids(hWnd)
732                  Case MENUID_GLYPH_X_10: glyph_x=10:Resize_Grids(hWnd)
733                  Case MENUID_GLYPH_X_12: glyph_x=12:Resize_Grids(hWnd)
734                  Case MENUID_GLYPH_X_14: glyph_x=14:Resize_Grids(hWnd)
735                  Case MENUID_GLYPH_X_16: glyph_x=16:Resize_Grids(hWnd)
736                  Case MENUID_GLYPH_X_18: glyph_x=18:Resize_Grids(hWnd)
737                  Case MENUID_GLYPH_X_20: glyph_x=20:Resize_Grids(hWnd)
738                  Case MENUID_GLYPH_X_22: glyph_x=22:Resize_Grids(hWnd)
739                  Case MENUID_GLYPH_X_24: glyph_x=24:Resize_Grids(hWnd)
740                  Case MENUID_GLYPH_X_26: glyph_x=26:Resize_Grids(hWnd)
741                  Case MENUID_GLYPH_X_28: glyph_x=28:Resize_Grids(hWnd)
742                  Case MENUID_GLYPH_X_30: glyph_x=30:Resize_Grids(hWnd)
743                  Case MENUID_GLYPH_X_32: glyph_x=32:Resize_Grids(hWnd)
744                  Case MENUID_GLYPH_X_48: glyph_x=48:Resize_Grids(hWnd)
745                  Case MENUID_GLYPH_X_64: glyph_x=64:Resize_Grids(hWnd)
746                  'GLYPH_Y
747                  Case MENUID_GLYPH_Y_4 : glyph_y= 4:Resize_Grids(hWnd)
748                  Case MENUID_GLYPH_Y_8 : glyph_y= 8:Resize_Grids(hWnd)
749                  Case MENUID_GLYPH_Y_10: glyph_y=10:Resize_Grids(hWnd)
750                  Case MENUID_GLYPH_Y_12: glyph_y=12:Resize_Grids(hWnd)
751                  Case MENUID_GLYPH_Y_14: glyph_y=14:Resize_Grids(hWnd)
752                  Case MENUID_GLYPH_Y_16: glyph_y=16:Resize_Grids(hWnd)
753                  Case MENUID_GLYPH_Y_18: glyph_y=18:Resize_Grids(hWnd)
754                  Case MENUID_GLYPH_Y_20: glyph_y=20:Resize_Grids(hWnd)
755                  Case MENUID_GLYPH_Y_22: glyph_y=22:Resize_Grids(hWnd)
756                  Case MENUID_GLYPH_Y_24: glyph_y=24:Resize_Grids(hWnd)
757                  Case MENUID_GLYPH_Y_26: glyph_y=26:Resize_Grids(hWnd)
758                  Case MENUID_GLYPH_Y_28: glyph_y=28:Resize_Grids(hWnd)
759                  Case MENUID_GLYPH_Y_30: glyph_y=30:Resize_Grids(hWnd)
760                  Case MENUID_GLYPH_Y_32: glyph_y=32:Resize_Grids(hWnd)
761                  Case MENUID_GLYPH_Y_48: glyph_y=48:Resize_Grids(hWnd)
762                  Case MENUID_GLYPH_Y_64: glyph_y=64:Resize_Grids(hWnd)
763                  '===================================================================
764                  'drawing glyph ratios
765                  case MENUID_RATIO_4 : ratio=4 : Resize_Grids(hWnd)
766                  case MENUID_RATIO_6 : ratio=6 : Resize_Grids(hWnd)
767                  case MENUID_RATIO_8 : ratio=8 : Resize_Grids(hWnd)
768                  case MENUID_RATIO_10: ratio=10: Resize_Grids(hWnd)
769                  '===================================================================
770                  'COLORS
771                  case MENUID_COLOR_BLACK : b_color=0        
772                  case MENUID_COLOR_BROWN : b_color=&H0b4080 
773                  case MENUID_COLOR_RED   : b_color=&h0000aa 
774                  case MENUID_COLOR_ORANGE: b_color=&H0055ff 
775                  case MENUID_COLOR_YELLOW: b_color=&H00dada 
776                  case MENUID_COLOR_GREEN : b_color=&h00aa00 
777                  case MENUID_COLOR_BLUE  : b_color=&haa0000 
778                  case MENUID_COLOR_VIOLET: b_color=&haa00aa 
779                  case MENUID_COLOR_WHITE : b_color=&Hffffff 
780                  '===================================================================
781                  'CUSTOM COLORS
782                  case MENUID_COLOR_CUSTOM
783                      dim as CHOOSECOLOR cc
784                      static as COLORREF customColors (0 to 15) = { &h00aaaaaa, &h00aaaaaa, _
785                                                                    &h00aaaaaa, &h00aaaaaa, _
786                                                                    &h00aaaaaa, &h00aaaaaa, _
787                                                                    &h00aaaaaa, &h00aaaaaa, _
788                                                                    &h00aaaaaa, &h00aaaaaa, _
789                                                                    &h00aaaaaa, &h00aaaaaa, _
790                                                                    &h00aaaaaa, &h00aaaaaa, _
791                                                                    &h00aaaaaa, &h00aaaaaa }
792                      with cc
793                          .lStructSize = sizeof(CHOOSECOLOR)
794                          .lpCustColors = @customColors(0)
795                          .Flags = CC_SOLIDCOLOR
796                      end with
797                      print ChooseColor( @cc )
798                      b_color = (cc.rgbResult)
799                  '===================================================================
800                  case MENUID_HELP_ABOUT : MessageBox(hWnd,help_text,"Picto-Font Help",MB_OK)
801              end select
802          case else : return DefWindowProc( hWnd, message , wParam, lParam )
803      end select
804      return 0
805  end function
806  '===============================================================================
807  '===============================================================================
808  'WinMain
809  '===============================================================================
810  '===============================================================================
811  function WinMain ( byval hInstance as HINSTANCE, _
812                     byval hPrevInstance as HINSTANCE, _
813                     byref szCmdLine as string, _
814                     byval iCmdShow as integer ) as integer
815      function = 0
816      dim appName as string = "Picto-Font"
817      dim wMsg as MSG
818      dim wcls as WNDCLASS
819          with wcls
820              .style         = CS_HREDRAW or CS_VREDRAW
821              .lpfnWndProc   = @WndProc
822              .cbClsExtra    = 0
823              .cbWndExtra    = 0
824              .hInstance     = hInstance
825              .hIcon         = LoadIcon( NULL, IDI_APPLICATION )
826              .hCursor       = LoadCursor( NULL, IDC_ARROW )
827              .hbrBackground = GetStockObject( LTGRAY_BRUSH )
828              .lpszMenuName  = NULL
829              .lpszClassName = strptr( appName )
830          end with
831      if( RegisterClass( @wcls ) = FALSE ) then
832          exit function
833      end if
834      ' Create window
835      hWnd = CreateWindowEx( 0, appname, _
836                             "Picto-Font Version 9.0 Febuary | 2019", _
837                             WS_OVERLAPPEDWINDOW, _
838                             200, _
839                             10, _
840                             800, _
841                             725, _
842                             NULL, _
843                             NULL, _
844                             hInstance, _
845                             NULL )
846  
847      ShowWindow( hWnd, iCmdShow )
848      UpDateWindow( hWnd )
849      while( GetMessage( @wMsg, NULL, 0, 0 ) <> FALSE )
850          TranslateMessage( @wMsg )
851          DispatchMessage( @wMsg )
852      wend
853      function = wMsg.wParam
854  end function
855  '===============================================================================
856  '===============================================================================
857  sub getfilename()
858          dim ofn as OPENFILENAME
859          dim filename as zstring * MAX_PATH+1
860          with ofn
861                  .lStructSize            = sizeof( OPENFILENAME )
862                  .hwndOwner              = hWnd
863                  .hInstance              = GetModuleHandle( NULL )
864                  
865                  if file_type="pft" then .lpstrFilter            = strptr( !"Picto-Font Files , (*.pft)\0*.pft\0\0")
866                  if file_type="bmp" then .lpstrFilter            = strptr( !"BitMap Files , (*.bmp)\0*.bmp\0\0")
867                  
868                  .lpstrCustomFilter      = NULL
869                  .nMaxCustFilter         = 0
870                  .nFilterIndex           = 1
871                  .lpstrFile              = @filename
872                  .nMaxFile               = sizeof( filename )
873                  .lpstrFileTitle         = NULL
874                  .nMaxFileTitle          = 0
875                  .lpstrInitialDir        = NULL
876                  .lpstrTitle             = @"Save File"
877                  .Flags                  = OFN_EXPLORER 'or OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST
878                  .nFileOffset            = 0
879                  .nFileExtension         = 0
880                  .lpstrDefExt            = NULL
881                  .lCustData              = 0
882                  .lpfnHook               = NULL
883                  .lpTemplateName         = NULL
884          end with
885          if( GetOpenFileName( @ofn ) = FALSE ) then
886              file = ""
887              return
888          else
889              dim ext as string
890              ext = right$(filename,4)
891              if file_type="pft" then
892                  if ext <> ".pft" then
893                      filename = filename + ".pft"
894                  end if
895              end if
896              if file_type="bmp" then
897                  if ext <> ".bmp" then
898                      filename = filename + ".bmp"
899                  end if
900              end if
901              
902              file = filename
903          
904          endif
905  end sub
906  '===============================================================================
907  '===============================================================================
908  'menu stuff below here
909  '===============================================================================
910  '===============================================================================
911  sub menu_insert( byval hmenu as HMENU, byval submenu as integer, byref title as string, byval flags as integer = 0 )
912      with submenuTB(submenu)
913              .hnd         = CreatePopupMenu( )
914              InsertMenu( hmenu, submenu, MF_BYPOSITION Or MF_POPUP Or MF_STRING or flags, cuint( .hnd ), title )
915      end with
916  end sub
917  '===============================================================================
918  sub menu_append( byval submenu as integer, byval id as integer, byref title as string, byval flags as integer = 0 )
919      AppendMenu( submenuTB(submenu).hnd, MF_STRING or flags, id, title )
920  end sub
921  '===============================================================================
922  sub menu_separator( byval submenu as integer )
923      AppendMenu( submenuTB(submenu).hnd, MF_SEPARATOR, 0, NULL )
924  end sub
925  '===============================================================================
926  sub init_menus( byval hWnd as HWND )
927      dim menu as HMENU
928      menu = CreateMenu( )
929      'File
930      menu_insert( menu, 0, "&File" )
931      menu_append( 0, MENUID_FILE_CLEAR, "&CLEAR-GLYPH" )
932      menu_append( 0, MENUID_FILE_OPEN, "&Open")
933      menu_separator( 0 )
934      menu_append( 0, MENUID_FILE_SAVE, "&Save")
935      menu_append( 0, MENUID_FILE_SAVE_AS_BMP , "&Save as BMP")
936      menu_separator( 0 )
937      menu_append( 0, MENUID_FILE_SAVE_INPUT_AS_BMP , "&Save Input as BMP")
938      menu_separator( 0 )
939      menu_append( 0, MENUID_FILE_EXIT, "&Exit" )
940      'brush_size_01's
941      menu_insert(menu, 1, "&Brush Size 1's")
942      menu_append( 1,MENUID_BRUSH_SIZE_0_ZERO,  "RESET ONES" )
943      menu_append( 1,MENUID_BRUSH_SIZE_0_1   ,  "1%" )
944      menu_append( 1,MENUID_BRUSH_SIZE_0_2   ,  "2%" )
945      menu_append( 1,MENUID_BRUSH_SIZE_0_3   ,  "3%" )
946      menu_append( 1,MENUID_BRUSH_SIZE_0_4   ,  "4%" )
947      menu_append( 1,MENUID_BRUSH_SIZE_0_5   ,  "5%" )
948      menu_append( 1,MENUID_BRUSH_SIZE_0_6   ,  "6%" )
949      menu_append( 1,MENUID_BRUSH_SIZE_0_7   ,  "7%" )
950      menu_append( 1,MENUID_BRUSH_SIZE_0_8   ,  "8%" )
951      menu_append( 1,MENUID_BRUSH_SIZE_0_9   ,  "9%" )
952      'brush_size_10's
953      menu_insert(menu, 2, "&Brush Size 10's")
954      menu_append( 2,MENUID_BRUSH_SIZE_ZERO_0, "RESET TENS" )
955      menu_append( 2,MENUID_BRUSH_SIZE_1_0   , "10%" )
956      menu_append( 2,MENUID_BRUSH_SIZE_2_0   , "20%" )
957      menu_append( 2,MENUID_BRUSH_SIZE_3_0   , "30%" )
958      menu_append( 2,MENUID_BRUSH_SIZE_4_0   , "40%" )
959      menu_append( 2,MENUID_BRUSH_SIZE_5_0   , "50%" )
960      menu_append( 2,MENUID_BRUSH_SIZE_6_0   , "60%" )
961      menu_append( 2,MENUID_BRUSH_SIZE_7_0   , "70%" )
962      menu_append( 2,MENUID_BRUSH_SIZE_8_0   , "80%" )
963      menu_append( 2,MENUID_BRUSH_SIZE_9_0   , "90%" )
964      'glyph_x
965      menu_insert(menu, 3, "&Glyph X Size")
966      menu_append(3,MENUID_GLYPH_X_4 ,"&4")
967      menu_append(3,MENUID_GLYPH_X_8 ,"&8")
968      menu_append(3,MENUID_GLYPH_X_10,"&10")
969      menu_append(3,MENUID_GLYPH_X_12,"&12")
970      menu_append(3,MENUID_GLYPH_X_14,"&14")
971      menu_append(3,MENUID_GLYPH_X_16,"&16")
972      menu_append(3,MENUID_GLYPH_X_18,"&18")
973      menu_append(3,MENUID_GLYPH_X_20,"&20")
974      menu_append(3,MENUID_GLYPH_X_22,"&22")
975      menu_append(3,MENUID_GLYPH_X_24,"&24")
976      menu_append(3,MENUID_GLYPH_X_26,"&26")
977      menu_append(3,MENUID_GLYPH_X_28,"&28")
978      menu_append(3,MENUID_GLYPH_X_30,"&30")
979      menu_append(3,MENUID_GLYPH_X_32,"&32")
980      menu_append(3,MENUID_GLYPH_X_48,"&48")
981      menu_append(3,MENUID_GLYPH_X_64,"&64")
982      'glyph_y
983      menu_insert(menu, 4, "&Glyph Y Size")
984      menu_append(4,MENUID_GLYPH_Y_4 ,"&4")
985      menu_append(4,MENUID_GLYPH_Y_8 ,"&8")
986      menu_append(4,MENUID_GLYPH_Y_10,"&10")
987      menu_append(4,MENUID_GLYPH_Y_12,"&12")
988      menu_append(4,MENUID_GLYPH_Y_14,"&14")
989      menu_append(4,MENUID_GLYPH_Y_16,"&16")
990      menu_append(4,MENUID_GLYPH_Y_18,"&18")
991      menu_append(4,MENUID_GLYPH_Y_20,"&20")
992      menu_append(4,MENUID_GLYPH_Y_22,"&22")
993      menu_append(4,MENUID_GLYPH_Y_24,"&24")
994      menu_append(4,MENUID_GLYPH_Y_26,"&26")
995      menu_append(4,MENUID_GLYPH_Y_28,"&28")
996      menu_append(4,MENUID_GLYPH_Y_30,"&30")
997      menu_append(4,MENUID_GLYPH_Y_32,"&32")
998      menu_append(4,MENUID_GLYPH_Y_48,"&48")
999      menu_append(4,MENUID_GLYPH_Y_64,"&64")
1000     'brush color
1001     menu_insert( menu, 5, "&Brush_Color" )
1002     menu_append(5,MENUID_COLOR_BLACK , "&Black" )
1003     menu_append(5,MENUID_COLOR_BROWN , "&Brown" )
1004     menu_append(5,MENUID_COLOR_RED   , "&Red"   )
1005     menu_append(5,MENUID_COLOR_ORANGE, "&Orange")
1006     menu_append(5,MENUID_COLOR_YELLOW, "&Yellow")
1007     menu_append(5,MENUID_COLOR_GREEN , "&Green" )
1008     menu_append(5,MENUID_COLOR_BLUE  , "&Blue"  )
1009     menu_append(5,MENUID_COLOR_VIOLET, "&Violet")
1010     menu_append(5,MENUID_COLOR_WHITE , "&White" )
1011     menu_separator( 5 )
1012     menu_append(5,MENUID_COLOR_CUSTOM, "&Custom")
1013     'ratio
1014     menu_insert(menu, 6, "&Glyph_Ratio")
1015     menu_append(6,MENUID_RATIO_4  , "&4"  )
1016     menu_append(6,MENUID_RATIO_6  , "&6"  )
1017     menu_append(6,MENUID_RATIO_8  , "&8"  )
1018     menu_append(6,MENUID_RATIO_10 , "&10" )
1019     'help
1020     menu_insert( menu, 7, "&HELP" )
1021     menu_append( 7 ,MENUID_HELP_ABOUT , "&About" )
1022     '===============================================================================
1023     SetMenu( hWnd, menu )
1024     DrawMenuBar( hWnd )
1025 end sub

الحل 1

قام مبرمجو Free BASIC بكتابة برنامج يسمى “Swig”

يمكنك تشغيله على ملف *.dll ويخرج ملف *.bi (تضمين BASIC) مثل ملف C (ملف رأس)

إذن يمكنك الاتصال بمكتبات C و windows من داخل BASIC.

[ad_2]

コメント

タイトルとURLをコピーしました