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
 Saving Image and DrawBackBuffer

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 - Jan 07 2015 : 11:51:18
Hi

I am using slippy maps with a TImageEnView component to display a map which I then draw contours on using the DrawBackBuffer.

I would like to save an exact copy of the map with the contours but when I do, I only get the map.

Is there any easy way that I can consolidate both the map and what I've drawn on the map and save or print it in its entirety?

Bruce.
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 12 2015 : 18:10:57
Hi Bruce

You didn't try the backbuffer which should already have your custom drawn content?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Jan 12 2015 : 10:12:42
Nigel

That last method you suggested worked:

ImageEnView1.iebitmap.CopyToTBitmap( aBmp );


which is strange because your previous suggestion

bmp.Assign( ImageEnView1.IEBitmap.VclBitmap );


didn't, neither did the one I initially tried.

Image.CopyToBitmapWithAlpha(bmp,0,0)
;

I then passed the bitmap canvas onto my contouring routine and voila!

I don't pretend to understand why that method works and the others bring back an empty or blank bitmap.

Thanks a lot.

Bruce.
xequte Posted - Jan 11 2015 : 15:21:33
Hi Bruce

Even if it is a virtual bitmap, the IEBitmap should still have content.

  aBmp := TBitmap.create;
  ImageEnView1.iebitmap.CopyToTBitmap( aBmp );
  // Do something with aBmp
  aBmp.Free;


But, now I think about it, if you have drawn to ImageEnView1.BackBuffer, why not just print ImageEnView1.BackBuffer? (there is a TBitmap print helper method in iexHelperFunctions).


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Jan 11 2015 : 05:01:11
Nigel

Image is a TImageEnView that I'm using for a slippy map container. Don't forget you have to assign a virtual bitmap provider:

Image.IEBitmap.VirtualBitmapProvider:=Map;


If I run your code and save the contents to a bitmap file its saves an empty (0k) bitmap file.

Bruce.
xequte Posted - Jan 10 2015 : 14:21:44
Hi Bruce

What is "Image" in this code?

You should be able to just assign the image of TImageEnView.IEBitmap, e.g. bmp.Assign( ImageEnView1.IEBitmap.VclBitmap );

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Jan 09 2015 : 10:51:27
Nigel

Thanks for the suggestion, but I had no luck when trying this code to grab the bitmap:


    bmp.Width:=Image.ClientWidth;
    bmp.Height:=Image.ClientHeight;
    bmp.PixelFormat:=pf24bit;
    Image.CopyToBitmapWithAlpha(bmp,0,0);


All I got was a white bitmap. Isn't the map some kind of virtual image and that's why I can't grab it or is it me?

In the mean time I'm using this Windows call which seems to do the trick, but obviously it would be better if I could just grab the map and the backbuffer straight from the slippymap component.


    bmp.Width:=Image.ClientWidth;
    bmp.Height:=Image.ClientHeight;
    bmp.PixelFormat:=pf24bit;

    bmp.Canvas.CopyRect(Rect(0,0,Image.Width,Image.Height),Canvas,Rect(
      Image.ClientOrigin.X,
      Image.ClientOrigin.Y,
      Image.ClientOrigin.X+Image.ClientWidth,
      Image.ClientOrigin.Y+Image.ClientHeight));


Bruce.
xequte Posted - Jan 07 2015 : 15:58:32
Hi Bruce

Why not copy the map to a bitmap, and then use your DrawBackBuffer code to draw the same data onto the bitmap (i.e. one method that takes a TCanvas that is used by both methods).

Then print the bitmap.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com