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
 GPS Maps Demo - Pins don't show when saved

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
Andy_Bell Posted - Mar 22 2021 : 20:10:46
Hi

Using C++ Builder 2007, I've converted the GPS Map demo to C++ and all looks good - until I try to save the map.

The pins drawn during the ImageEnView1DrawBackBuffer event show on the map but are not present when I save the ImageEnView.

I've tried saving to TIF and to JPEG but it makes no difference.

The Delphi demo exhibits the same behavior...

Is there a way to get the pins to save?

Andy

Andy
2   L A T E S T    R E P L I E S    (Newest First)
Andy_Bell Posted - Mar 23 2021 : 04:50:32
Thank you!

Works perfectly

Andy

Andy
xequte Posted - Mar 22 2021 : 21:42:15
Hi Andy

The pins in the demo are only drawn on the back buffer, so you would need to use code to burn them into the image if you wanted them to be visible when saved.

Here is one method that adds the locations as Pin shape layers, then saves the merged layer to a file:

const
  Pin_Width  = 40;
  Pin_Height = 40;
var
  i: integer;
  idx: integer;
  lat, lon: double;
  x, y: integer;
  fn: string;
begin
  // Prompt for a filename
  fn := ImageEnView1.IO.ExecuteSaveDialog();
  if fn = '' then
    exit;

  // Hide changes from view
  ImageEnView1.LockUpdate();
  try

    // Add pins as shape layers
    for i := 0 to ImageEnMView1.MultiSelectedImagesCount - 1 do
    begin
      idx := ImageEnMView1.MultiSelectedImages[i];
      lat := ImageEnMView1.MIO.Params[idx].EXIF_GPSLatitude;
      lon := ImageEnMView1.MIO.Params[idx].EXIF_GPSLongitude;
      x := map.LongitudeToBmpX(lon);
      y := map.LatitudeToBmpY(lat);

      ImageEnView1.LayersAdd( iesPinLeft, x, y - Pin_Height, Pin_Width, Pin_Height );
    end;

    // Save current image + layers to file
    ImageEnView1.LayersSaveMergedTo( fn );

    // Clean up
    ImageEnView1.LayersClear(False);

  finally
    // Reenable ImageEnView1
    ImageEnView1.UnlockUpdate();
  end;
end;


Nigel
Xequte Software
www.imageen.com