imageBrowser 1.11 class

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

[quote=193979:@Christoph De Vocht]No offence intended. Long toes? :wink:
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…

[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…

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

Yep, I ran into it too. Thanks noted.

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.

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=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]

Yes, that would be a great addition.

[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-

[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.

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.

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

Maybe for a future version. :slight_smile:

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



Addition:

  • 25€ unencrypted / 15€ encrypted.

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