ScrollArea

Post your Gambas programming questions here.
Post Reply
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

ScrollArea

Post by Quincunxian »

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: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ScrollArea

Post by cogier »

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 398 times
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: ScrollArea

Post by Quincunxian »

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: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ScrollArea

Post by cogier »

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 387 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.
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: ScrollArea

Post by grayghost4 »

cogier wrote: 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
this is the kind of help I like .... short and to the point .
it save me a lot of time looking through someone else's 5 page program looking for the way to load a picture file
Thanks
Post Reply