ScrollArea

Post Reply
User avatar
Quincunxian
Posts: 55
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

ScrollArea

Post by Quincunxian » Friday 09th August 2019 2:40am

Does anybody have some sample code of loading an image into a ScrollArea control.
I know that I've done this before but can't find the way now. ( was a very long time ago)
The requirement is to load a large 1024 x 4096 image and be able to scroll various parts.

Note# the ScrollArea.View is supposed to be the internal drawing area but is read only so can't be used as a normal DrawingArea to load images.

Any sample code appreciated.
Cheers - Quin.
I code therefore I am

User avatar
cogier
Site Admin
Posts: 297
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ScrollArea

Post by cogier » Friday 09th August 2019 2:10pm

The ScrollArea seems to have some complicated options. Getting a picture in is not too difficult, getting it to scroll will need more work, but attached is a start.

Image
Test.tar.gz
(33.33 KiB) Downloaded 6 times

User avatar
Quincunxian
Posts: 55
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: ScrollArea

Post by Quincunxian » Saturday 10th August 2019 1:19am

Thanks Cogier - the download file does not appear to work - just get a blank archive.
Can you repost please.

I did manage to do what I want with an ImageView control but not sure it will provide the full functionality that I'm trying to achieve. Will be very interested to see your code.

Perhaps one of the most frustrating things I find about Gambas is if you want to do something a little different, especially in the graphics area, then you spend 70% of the time working out how to use the functions/controls.
(don't get me wrong - that's fun too but sometimes it gets a little stale)

The availability of good Gambas examples would mean a much better uptake of the language overall.
Rittinghouse's book is a great start but there needs to be an update as its now almost 14(?) years old.
Cheers - Quin.
I code therefore I am

User avatar
cogier
Site Admin
Posts: 297
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ScrollArea

Post by cogier » Saturday 10th August 2019 10:05am

Hi Quin,

Sorry it didn't work for you. I downloaded it and it seems OK, however here it is again in a different format and the code as well.
Public Sub ScrollArea1_Draw()

Draw.Picture(Picture.Load(Application.Path &/ "test.png"), 150, 150, 300, 300)

End
Test.tar
(289 KiB) Downloaded 3 times
Regarding the state of Gambas examples more of us need to put up code when we have worked it out. I recently added some code to Picture.Mode as there was nothing, but as you say it was fun understanding it.

I have not heard of 'Rittinghouse's book', I will have to have a look at it.

Post Reply