PDA

View Full Version : Suggestion: LoadThumbnail :: cImageContainer



raveens
30-Dec-2019, 05:01 PM
Hi DAW

Would DAW consider modifying the LoadThumbnail procedure to make it more modular to allow developers to have custom sizing for thumbnails ?

Basically, changing it to:




// Thumbnail_Dimensions allows developers to overwrite/augment thumbnail sizing
Procedure Thumbnail_Dimensions Integer ByRef iImageWidth Integer ByRef iImageHeight
Decimal decThumbnailFactor
Handle hoImage
Get phoImage to hoImage
If (hoImage <> 0) Begin
Get ImageWidth of hoImage to iImageWidth
Get ImageHeight of hoImage to iImageHeight


Get pdecThumbnailFactor to decThumbnailFactor
Move (iImageWidth * decThumbnailFactor) to iImageWidth
Move (iImageHeight * decThumbnailFactor) to iImageHeight
End
End_Procedure


Procedure LoadThumbnail
Integer iImageWidth iImageHeight
Handle hoImage hoImageThumbnail
Boolean bAutoTooltip


Get phoImage to hoImage
If (hoImage <> 0) Begin


Move 0 to iImageWidth
Move 0 to iImageHeight
Send Thumbnail_Dimensions (&iImageWidth) (&iImageHeight)


Get CreateThumbnail of hoImage iImageWidth iImageHeight to hoImageThumbnail
If (hoImageThumbnail <> 0) Begin
Send RemoveBitmap
Set phoImage to hoImageThumbnail
Send Destroy of hoImage


Get pbAutoTooltip to bAutoTooltip
If (bAutoTooltip) Begin
Send AssignTooltip
End
End
End
End_Procedure

Vincent Oorsprong
30-Dec-2019, 10:27 PM
Raveen,

While we can add such a feature I don't see much need to this. The resize should IMHO be a ratio based resize.

PS: Note that there is a huge difference between resizing and making thumbnails. With the current knowledge I would hesitate to create thumbnails at all.

raveens
30-Dec-2019, 10:46 PM
Note that there is a huge difference between resizing and making thumbnails. With the current knowledge I would hesitate to create thumbnails at all.

That is true !! Hence why the request above to ease this issue.

We have a cThumbImageContainer class that always creates 100x100 thumbnail images irrespective of the source image while maintaining the image dimensions...its ridiculously complex.
Basically, had to rewrite LoadThumbnail procedure of the base class, instead of forward sending it because the resizing calculation was not flexible.