ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Copying from a slippymap into a TImageEnMView or TImageENview component.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bmesser Posted - Oct 18 2026 : 07:11:05
Hi

I have been using this function (see below) for many years to copy the content of an ImageEnView using TSlippyMap first into a TBitMap before transfering into another TImageEnMView control.

I draw to the canvas and add layers that overlay on the map.

I've tried all the ways to do this using the assign methods with a TBitMap or TIEBitmap without success.
What I've drawn on the canvas never makes it through, although the layers sometimes do.

There must be a method of doing this cleanly, because this should be easy peasy.

I've had long conversations with AI with no luck at all.#128558;

Can someone help me out?

There has got to be a better method of creating and saving bitmaps to make this transfer.

Bruce.

function CopyControlToBMP(AControl: TWinControl; border: boolean = False): TBitMap;
var
  DC : HDC;
begin
  result:=TBitmap.Create;
  result.SetSize(AControl.ClientWidth,AControl.ClientHeight);
  result.PixelFormat:=pf32bit;

  DC:=GetWindowDC(AControl.Handle);

  try
    BitBlt(result.Canvas.Handle,0,0,result.Width,result.Height,DC,1,1,SrcCopy);

    if border then
    begin
      result.Canvas.Brush.Color:=clBlack;
      result.Canvas.FrameRect(rect(0,0,result.Width,result.Height));
    end;
  finally
    ReleaseDC(AControl.Handle,DC);
  end;
end;
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 18 2026 : 14:56:55
Hi Bruce

What happens when you just use:

ImageEnView1.IO.SaveToFile('D:\map.jpg');

Which works fine when we test it here. If you're seeing something different, can you confirm what version of ImageEn you are using?

If you need location pins too, see the "Save as Image" method in the GeoMaps demo:

\Demos\InputOutput\GeoMaps\geomaps.dpr

Nigel
Xequte Software
www.imageen.com