|
-
May 29th, 2022, 05:46 AM
#10
picbox > ImageList extract to dragIcon causes black square
PROBLEM: I am populating a control's dragIcon from an MSCOMCTL imageList control but the resulting dragIcon is black when I use Krool's imageList. However, it all works fine with the MSCOMCTL imageList control.

BACKGROUND:
The source image is a PNG. The source image is written to a temporary picBox named picDragIcon using the picbox device context using GDI+, specifically, GdipDrawImageRectRectI. To accomplish this, I am using LaVolpe's C32dppDIP method to read PNGs into a VB6 picture control. In this case the picbox is merely a temporary holding control and I want to put that image into a dragIcon.
First step, I use an MSCOMCTL imageList and add the image from the temporary picbox as the sole image in the imageList.
Code:
ImageList1.ListImages.Add , "arse", picDragIcon.Image
I then extract that image from the imageList and set it to be the dragIcon for the target control.
Code:
picRdMap(Index).DragIcon = ImageList1.ListImages("arse").ExtractIcon
As a result, the dragIcon shows perfectly. Why do I use an imageList? If I load the dragIcon directly from the temporary picBox as below:
Code:
picRdMap(Index).DragIcon = picDragIcon.Image ' this only works for .ico types
Then the dragIcon shows nothing, nothing at all. I think it is due to the fact that the temporary image is rendered using GDI+ or only handles .ico types. That is why I use the MSCOMCTL imageList as it somehow seems to convert the GDI+ rendered image on the picBox correctly to something the .dragIcon can use. Some sort of bitmap, anyhow, it does the job.
However, back to my problem. I want to use Krool's version of the imageList control. I prefer to use Krool's imageList as I have so far avoided using any control from MSCOMCTL instead using all of Krool's alternatives.

If I substitute Krool's imagelist the dragicon is a black square. Any ideas? I suspect this is because Krool's control is not expecting a transparent image in a standard picturebox. Any guidance would be useful.
Last edited by yereverluvinuncleber; May 29th, 2022 at 06:37 AM.
Reason: Managed to add some screenshots
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|