Shapefile Category Point Image Problem

Hi, I have a problem similar to the closed topic:

I’m have a point shapefile with PointSymbol set to ptSymbolPicture. It’s working fine if I load a image from a local file using the image Open() function and set the category options.

But I’m try to use the Pointsymbol from a in memory ImageList (my code is in Delphi), using the hDC of my image. For this I’m using the SetImageBitsDC() function.
It’s working fine but the image is showed inverted and on botton of point coordenate instead on top.

To solve this I tryed to change the propertyes “AlignPictureByBottom” to true/false and “PointReflection” to prtTopToBottom, but without sucess.
I think, this is a problem with MapWinOCX.

Does anyone could please help me, or have a sugestion?
My code is:

//image point
img1:= CoImage.Create;
img1.CreateNew(37,37);
ImageList2.GetBitmap(0,Image1.Picture.Bitmap); //get image from ImageList
img1.SetImageBitsDC (Image1.Picture.Bitmap.Canvas.Handle); //blue dam image
img1.TransparencyColor := clWhite;
//category
shpCat:= Shp.Categories.Add('UF=PB shapes');
shpCat.Expression := '[UF] = "PB"';
shpCat.DrawingOptions.SetDefaultPointSymbol(tkDefaultPointSymbol(ptSymbolPicture));
shpCat.DrawingOptions.PointType := ptSymbolPicture ;
shpCat.DrawingOptions.Picture :=  img1 ;
shpCat.DrawingOptions.PointReflection := prtTopToBottom ; //inverted image work
shpCat.DrawingOptions.AlignPictureByBottom := true;

My screen capture is shows below, the first image is inverted and the second (using open function) is correct:
image

image

After a lot tests I figure out that the prroblem is with SetImageBitsDC() function.
Even if I load a PNG transparent from a local file, and call SetImageBitsDC() the image is showed inverted and with a black background (no transparence) as we can see on first image above.

So, I sure that there is a problem with SetImageBitsDC() function. I supose this should work as the same way of Open() function.

Pmeems, can you or anyone please verify this? Thaks.

Can’t you just use img.Open() like it is done in this example: MapWinGIS: TrackCars.cs

Hi Pmeems, thank you for your time.

Yes, I did with open() function this is showed in the 2th figure above. But I am programming in pascal and I don’t want load the images from a file but from an imagelist I’m memory, just because I don’t want send my image files to user.
So, to load from my imagelist in memory I have to use the SetImageBitsDC() because I didn’t find other way to do this.

Have a way you create a simple code to test and confirm if there is a problema with the SetImageBitsDC() function? if it is a bug cold you open a new topic to correct this?

Thanks