# imageBrowser 1.11 class

**URL:** <https://forum.xojo.com/t/imagebrowser-1-11-class/24858>\
**Category:** Extras\
**Created:** [June 11, 2015, 2:05pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858 "2015-06-11T14:05:42Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![Peter\_Fargo](https://forum.xojo.com/user_avatar/forum.xojo.com/peter_fargo/32/977_2.png) [@Peter\_Fargo](https://forum.xojo.com/u/Peter_Fargo)\
**Post date:** [June 13, 2015, 11:05am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/21 "2015-06-13T11:05:57Z")

</div>

Refresh issue (OS X) - When drag reordering the blue drop indicator remains in the background until the browser is scrolled.

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 13, 2015, 11:06am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/22 "2015-06-13T11:06:33Z")

</div>

[quote=193979:@Christoph De Vocht]No offence intended. Long toes? 😉  
I was just pointing out there is already a native OS X control for this. So if a dev is only coding for OS X there is no need for this.  
But yours is certainly useable when you need cross platform compatibility.

Did you consider a scalable ImageBrowser? Could not find this in the current version.[/quote]

If a dev is coding for OSX he probaply won’t use Xojo either way as would use a bunch of declares over all for  
it making Xojo trival. You’ve just named a plugin which is alread written for you and you don’t have any work. Wow…

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [June 13, 2015, 2:13pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/23 "2015-06-13T14:13:04Z")

</div>

[quote=194017:@Rob Egal]If a dev is coding for OSX he probaply won’t use Xojo either way as would use a bunch of declares over all for  
it making Xojo trival. You’ve just named a plugin which is alread written for you and you don’t have any work. Wow…[/quote]

Thank you for misunderstanding my point. Figures…

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [June 13, 2015, 3:49pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/24 "2015-06-13T15:49:37Z")

</div>

What about my question: “Did you consider a scalable ImageBrowser? Could not find this in the current version.”

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 14, 2015, 2:18pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/25 "2015-06-14T14:18:36Z")

</div>

> [@194016:@Peter Fargo](#):
>
> Refresh issue (OS X) - When drag reordering the blue drop indicator remains in the background until the browser is scrolled.

Yep, I ran into it too. Thanks noted.

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 14, 2015, 2:24pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/26 "2015-06-14T14:24:06Z")

</div>

> [@194090:@Christoph De Vocht](#):
>
> What about my question: “Did you consider a scalable ImageBrowser? Could not find this in the current version.”

What do you mean whith scalable ? If you rezise the control, the icons will be arranged in a sort of grid instead of only a single line ?  
Or if you size the control, the icons will be scaled too ? The fist one is on my list.

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [June 14, 2015, 2:51pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/27 "2015-06-14T14:51:23Z")

</div>

Mouse Click on the ImageWell crashes the app.

change MouseDown to

` if me.Image <> nil then
    dim drag as new DragItem(self,me.MouseX,me.MouseY,60,80,nil)
    drag.Picture = me.Image
    drag.Drag
  end if`

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [June 14, 2015, 4:22pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/28 "2015-06-14T16:22:06Z")

</div>

[quote=194215:@Rob Egal]What do you mean whith scalable ? If you rezise the control, the icons will be arranged in a sort of grid instead of only a single line ?  
Or if you size the control, the icons will be scaled too ? The fist one is on my list.[/quote]

I clicked the full screen button on your demo project. Interestingly enough the class autoresizes fairly well. After adding RubberViews to the project, everything gets proportioned. However, the pictures tend to show a bit too small. Maybe you should think of a way to show pictures larger.

Also, I tried to load images from files. The first jpg went fine, then all others failed to display. I also noticed the one that worked was not resized proportionnaly.

You may want to use this Jay Madren posted not long ago :

[code]Function ProportionalScale(extends Pic as Picture, Width as integer, Height as Integer) As Picture  
// Calculate scale factor  
dim factor as Double = min( Height / Pic.Height, Width / Pic.Width )

// Calculate new size  
dim w as integer = Pic.Width \* factor  
dim h as integer = Pic.Height \* factor

// create new picture  
dim NewPic as new Picture( w, h, 32 )

// draw picture in the new size  
NewPic.Graphics.DrawPicture( Pic, 0, 0, w, h, 0, 0, Pic.Width, Pic.Height )

// return scaled image  
Return NewPic

End Function[/code]

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [June 14, 2015, 7:36pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/29 "2015-06-14T19:36:40Z")

</div>

> [@194215:@Rob Egal](#):
>
> Or if you size the control, the icons will be scaled too ? The fist one is on my list.

Yes, that would be a great addition.

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 15, 2015, 5:13pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/30 "2015-06-15T17:13:29Z")

</div>

[quote=194217:@Axel Schneider]Mouse Click on the ImageWell crashes the app.

change MouseDown to

` if me.Image <> nil then
    dim drag as new DragItem(self,me.MouseX,me.MouseY,60,80,nil)
    drag.Picture = me.Image
    drag.Drag
  end if`[/quote]

Thx.Fixed That-

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 15, 2015, 6:04pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/31 "2015-06-15T18:04:26Z")

</div>

[quote=194235:@Michel Bujardet]I clicked the full screen button on your demo project. Interestingly enough the class autoresizes fairly well. After adding RubberViews to the project, everything gets proportioned. However, the pictures tend to show a bit too small. Maybe you should think of a way to show pictures larger.

Also, I tried to load images from files. The first jpg went fine, then all others failed to display. I also noticed the one that worked was not resized proportionnaly.

You may want to use this Jay Madren posted not long ago :

[code]Function ProportionalScale(extends Pic as Picture, Width as integer, Height as Integer) As Picture  
// Calculate scale factor  
dim factor as Double = min( Height / Pic.Height, Width / Pic.Width )

// Calculate new size  
dim w as integer = Pic.Width \* factor  
dim h as integer = Pic.Height \* factor

// create new picture  
dim NewPic as new Picture( w, h, 32 )

// draw picture in the new size  
NewPic.Graphics.DrawPicture( Pic, 0, 0, w, h, 0, 0, Pic.Width, Pic.Height )

// return scaled image  
Return NewPic

End Function[/code][/quote]

Hi Michel  
Thank you so much for checking.

[quote]Also, I tried to load images from files. The first jpg went fine, then all others failed to display. I also noticed the one that worked was not resized proportionnaly.  
[/quote]

I’ve fixed that too. Images added afterwards will be shown correctly but I couldn’t find issues with the proportions.

> [@](#):
>
> I clicked the full screen button on your demo project. Interestingly enough the class autoresizes fairly well. After adding RubberViews to the project, everything gets proportioned. However, the pictures tend to show a bit too small. Maybe you should think of a way to show pictures larger.

The icon size is not fixed. It’s just for the demo. If you need other dimensions you just need to change. I must admit,however, an automatic rescale flag could be useful the more I think about it. I’ll add the feature with 1.03.

In case I got you wrong please give me a screenshot and prove me detail information.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [June 15, 2015, 8:04pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/32 "2015-06-15T20:04:27Z")

</div>

I just notices a rather good example of horizontal image picker at the bottom of the page at [http://cbs.com](http://cbs.com) to select among CBS Classics. It looks very much like your control, but horizontally.

Maybe for a future version. 🙂

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [October 7, 2015, 7:34am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/33 "2015-10-07T07:34:09Z")

</div>

imageBrowser v1.11 is available now

[code]changelog:  
imageBrowser v1.11 - Oct. 7th, 2015  
New features:

- improved selection customization
- added slide show effect (see demo browser)
- added new demo example
- control will refresh after dragitem has been released
- added property “ctrlScaleIcons” to scale icons to the resizing control
- added new grid (view) mode enabling the control show icons in a raster
- added a new drag/drag-reorder visual effect and removed the blue anchor line
- enabled scrolling when drag-reorder is enabled
- added “classVersion” returning current class name and version
- improved page scrolling  
BugFixes:
- images added (from files) and outside of the demo respectively will be displayed correctly
- cleaned up code and renamed control properties
- remove unnecessary events
- added more demo examples and a demo browser[/code]

You can now purchase the free unencrypted Xojo project files for 15 /15 USD. Please contact me via PM for more details.

Here’s the current 1.11 demo version (MacOSX)  
[https://www.dropbox.com/s/mbzuxwupmocdgrb/ImageBrowser1\_11\_encrypted.xojo\_binary\_project?dl=0](https://www.dropbox.com/s/mbzuxwupmocdgrb/ImageBrowser1_11_encrypted.xojo_binary_project?dl=0)

[![](http://fs5.directupload.net/images/151007/temp/ppbw3ieh.jpg)](http://www.directupload.net/file/d/4133/ppbw3ieh_jpg.htm)  
[![](http://fs5.directupload.net/images/151007/temp/wmxwxxfr.jpg)](http://www.directupload.net/file/d/4133/wmxwxxfr_jpg.htm)  
[![](http://fs5.directupload.net/images/151007/mzb7be6r.jpg)](http://www.directupload.net)

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [October 9, 2015, 5:46pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/34 "2015-10-09T17:46:00Z")

</div>

Addition:

- 25 unencrypted / 15 encrypted.

---

<div class="post-metadata">

**Author:** ![Valdemar\_De\_SOUSA](https://forum.xojo.com/user_avatar/forum.xojo.com/valdemar_de_sousa/32/21374_2.png) [@Valdemar\_De\_SOUSA](https://forum.xojo.com/u/Valdemar_De_SOUSA)\
**Post date:** [September 21, 2016, 12:15pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/35 "2016-09-21T12:15:07Z")

</div>

It seems to be broken with 2016r3 !! image disappear when slide

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:48pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/36 "2020-10-29T17:48:00Z")

</div>



[Previous page](https://forum.xojo.com/t/imagebrowser-1-11-class/24858.md?page=1)
