Advertisement
jargon

Why does this image not create?

Jan 31st, 2021
3,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub Sx_Scale_Image( _
  2.     src_img as any ptr, _
  3.     new_img as any ptr, _
  4.     new_w as integer = 8, _
  5.     new_h as integer = 8 _
  6. )
  7.  
  8.     dim as integer src_w=0,src_h=0
  9.     dim as any ptr new_mask
  10.  
  11.     if Sx_Image_About(src_img,src_w,src_h)=0 then exit sub
  12.  
  13.     new_img=imagecreate(new_w,new_h)
  14.     line new_img,(0,0)-(new_w-1,new_h-1),0,bf
  15.    
  16.     new_mask=imagecreate(new_w,new_h)
  17.     line new_mask,(0,0)-(new_w-1,new_h-1),0,bf
  18.        
  19.     Sx_Glyph_Refresh src_img, new_img, new_mask
  20.    
  21.     imagedestroy new_mask
  22.    
  23. end sub
  24.  
  25. sub Sx_Scale_Put( _
  26.     src_img as any ptr , _
  27.     x0 as integer = 0, _
  28.     y0 as integer = 0, _
  29.     x1 as integer = 7, _
  30.     y1 as integer = 7 _
  31. )
  32.  
  33.     dim as integer _
  34.         new_w=x1-x0+1, _
  35.         new_h=y1-y0+1
  36.    
  37.     dim As fb.Image Ptr  _
  38.         new_img
  39.    
  40.     Sx_Scale_Image _
  41.         src_img, new_img, new_w, new_h
  42.  
  43.     put(x0,y0),new_img,pset
  44.    
  45.     imagedestroy new_img
  46.    
  47. end sub
  48. ```
  49. C:\Data\dungeon\graphics.bas(187) error 14: Expected identifier, found 'fb' in 'dim As fb.Image Ptr  _'
  50. C:\Data\dungeon\graphics.bas(191) error 42: Variable not declared, new_img in 'src_img, new_img, new_w, new_h'
  51. C:\Data\dungeon\graphics.bas(193) error 14: Expected identifier, found 'new_img' in 'put(x0,y0),new_img,pset'
  52. C:\Data\dungeon\graphics.bas(195) error 1: Argument count mismatch, found 'new_img' in 'imagedestroy new_img'
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement