Create thumbnails from clipboard / pure Visual Basic 6.0
$30-250 USD
In Progress
Posted about 14 years ago
$30-250 USD
Paid on delivery
Context:
The required Visual Basic 6.0 function will be part of a PowerPoint COM Add-In.
Either a single PowerPoint slide or several shapes will be copied to the clipboard by the Add-In.
In both cases, PowerPoint automatically generates a bitmap representation of the slide / shapes in the clipboard.
Project description:
The required function needs to generate a .png thumbnail from the PowerPoint-generated bitmap clipboard contents (single slide / multiple shapes).
Input parameters:
- Width and height of thumbnail (in pixels)
- Path to thumbnail file
- Background color as RGB value (applies if original aspect ratio is not equal to thumbnail aspect ratio)
Output:
- .png thumbnail saved to specified path on disk
- Downsizing in high quality incl. anti-aliasing (use GDI+)
- Original aspect ratio is to be maintained
- If original aspect ratio is not equal to thumbnail aspect ratio, contents are to be centered horizontally / vertically
- Function to return true if thumbnail has been created successfully, false otherwise
Further requirements:
- Documented Visual Basic 6.0 source code
- Single .bas module, no forms, no classes
- Pure VB6, standard Windows API and [login to view URL], no other components (.dll, .ocx) are to be used
- No temporary files are to be created (all intermediate operations need to happen in memory, not on disk)
- Clipboard is to be cleared after reading bitmap
Pseudo code:
Public Function CreateThumbnail(Width as Integer, Height as Integer, BackColor as Long, Path as String) as Boolean
OpenClipboard
Bitmap = GetBitmapFromClipboard()
ClearClipboard
CloseClipboard
PNG = CreateThumbnail(Bitmap, Width, Height, BackColor) 'Maintain aspect ration and center horizontally / vertically
SavePNGtoPath PNG, Path
CreateThumbnail = success 'return true if thumbnail was created successfully, otherwise false
End Function
Milestone payments:
1. Fully functional sample .exe which creates thumbnail from clipboard and saves it to disk as .png (test dimensions: 150x100 pixels)
2. Fully documented source code