Jump to content

Recommended Posts

Posted

FIrst of all, I apologize for the state of how it all looks as I had to remove thousands of lines to make a workable demo. It works, but it's not pretty. So if you see any inconsistencies just handwave it and they'll go away.

1. First issue is with Global $idPic = GUICtrlCreatePic('', 10, 45, 720, 405) on line 15.
It works well however I want to center the image in the control by using $SS_CENTERIMAGE. The moment I add that style and click on a different image the new one simply repaints on top of the old one. Refer to function Func1 for repainting. I could always resize the picture control and place it in the middle based on the bitmap passed but seems like the $SS_CENTERIMAGE is (should be) the perfect solution.

2. Next is the fact that I couldn't find a way to make images scrollable with a horizontal bar only in the list view. Basically one row and infinite columns is what I'd like. I tried formatting the list with with just 1 item and all the rest are subitems however the images are not displayed. Seems like the isssue is with the _GUICtrlListView_SetView($idListview, 0). Specifically the fact that 0 value refers to large icons and the list is then treated differently. I'm wondering if there are any workarounds or similar solutions.

3. It seems there's a memory leak in function Func1. RAM increases each time a new thumbnail is loaded without releasing the old one when next one is drawn.

  Reveal hidden contents

Any help is much appreciated. Been stuck on couple of these for a few days now.

Posted

Maybe consider deliberate repositioning, based on window and image widths and using On Event for window resize detection for your first issue.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Posted
  On 7/18/2023 at 11:34 AM, TheSaint said:

Maybe consider deliberate repositioning, based on window and image widths and using On Event for window resize detection for your first issue.

Expand  

A solution I considered.

  On 7/21/2023 at 10:41 AM, Zedna said:

Sorry for not helping, just want to say it's (simple) nice example using Listview for images preview ...

Expand  

I've seen it somewhere before tbh, not my idea. Don't remember where.

 

Anyway, I can find workarounds for the first 2 however I'm not sure what to do with the third one.

According to this article https://learn.microsoft.com/en-us/windows/win32/controls/stm-setimage the leak needs to be cleaned manually however it doesn't work. There's no error, _WinAPI_DeleteObject() should do the trick but it doesn't...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...