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: