Heya, Danilo. How you doing?  
Will post whole bangshoot of code (or link to a zip) if you want, but here is a little klurge which I was playing with to see if I could find a solution:
Code: Select all
#_wMain=0
#_Pic=111
#_Canvas=112
#_imgGad=151
#_scroll=211
hWnd=OpenWindow(#_wMain, 10,10, 620,460, #PB_Window_SystemMenu, "SpriteEditor")
If hWnd
  CreateGadgetList(hWnd)
  fil.s="C:\masm32\00HLL\PureBasic\me\imgUtils\Source\standSE.bmp"
  LoadImage(#_Pic,fil)
  CopyImage(#_Pic,#_Canvas)
  hImg=UseImage(#_Pic)
  iWide=ImageWidth()
  iHigh=ImageHeight()
  multex=10
  ResizeImage(#_Canvas,iWide*multex,iHigh*multex)
  hImg=UseImage(#_Canvas)
  ScrollAreaGadget(#_scroll,0,0,400,300, iWide*multex,iHigh*multex, 3,#PB_ScrollArea_Single)
  ImageGadget(#_imgGad,0,0,iWide*multex,iHigh*multex, hImg)
  CloseGadgetList()
  StartDrawing(ImageOutput())
  For i=1 To iHigh
    LineXY(0,i*multex-multex,iWide*multex-1,i*multex-multex,RGB(192,192,192))
  Next
  For i=1 To iWide
    LineXY(i*multex,1,i*multex,iHigh*multex,RGB(192,192,192))
  Next
  StopDrawing()
  hImg=UseImage(#_Canvas)
;redraw to get it showing - comment out next 3 lines and the lineXY above not seen.
  OpenGadgetList(#_scroll)
  ImageGadget(#_imgGad,0,0,iWide*multex,iHigh*multex, hImg)
  CloseGadgetList()
  Repeat
    EventID.l = WaitWindowEvent()
    Select EventID
      Case #PB_EventCloseWindow
        Quit = 1
    EndSelect
  Until Quit = 1
EndIf
End
BTW, the portability thing is not an issue, just wanted to see if I could make it work.  
You ask some tough questions  
   
 
So far I have only managed to make a working editor (clunky, but working) without the scrollArea, and by forcing image to be under 100x100 pixels. Okay for tiles and sprites, but bigger would be better.
At the moment I can't track things (mouse/keyboard) without using windows references, eg, #WM_KEYDOWN, #WM_LBUTTONDOWN.
I am using the keyboard to scroll around the "canvas" area, and paint, but my mouseclicks (with or without scrollArea) are way out and I haven't conquered the metrics yet.
So the offset within a scrollAreaGadget that won't talk back is going to be interesting.  

  Glad you pointed that out., because I hadn't got that far yet, I got stuck on the refresh thing. It would have been the next hole I fell in.
LOL - I have a long way to go and a lot to learn (and holes to fall into) it seems.
Thanks for the response.
PS: Haven't attacked the MIDI thing yet.   8O   I am beginning to think it may be a bit ambitious for me at this point.  I will just write the game and use jazz or something to write the music.
The offer for your brain still stands.