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
 combine vector and image in the pdf

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
srtt Posted - Jun 04 2024 : 10:09:00
What I want to do is to place the original image behind a vector pdf. so I can see the details better. Can I do this using imagen?
I did it with inkscape. but I don't want to use it. I want to do it with imageen.

sample pdf, original image and pdf I made in inkscape.


orjinal image



traced vector pdf



inkscape
12   L A T E S T    R E P L I E S    (Newest First)
srtt Posted - Jun 11 2024 : 05:18:17
ok. thank you for your help
xequte Posted - Jun 11 2024 : 04:27:09
Hi

Unfortunately PDFium does not support SendToBack commands or z-order editing.

Your only option would be to:

1. Copy the two objects to TIEBitmaps:

http://www.imageen.com/help/TPdfObject.GetImage.html

2. Remove the objects:

http://www.imageen.com/help/TPdfObjectList.RemoveObject.html

3. Add them back in the correct order:

https://www.imageen.com/help/TPdfObjectList.AddImage.html

Nigel
Xequte Software
www.imageen.com
srtt Posted - Jun 11 2024 : 03:54:52


This is my 1 page pdf file.
How can I bring the (traced vector) object behind to the front?
Or how can I get the front bitmap image to the back?

How do I do this in pdf?

imaeenview1.pdfviewer.bitmap[0].sendtoback;
Is there a similar command like the command.

xequte Posted - Jun 10 2024 : 05:19:13
Sorry, I'm not following what you are trying to achieve.



Nigel
Xequte Software
www.imageen.com
srtt Posted - Jun 10 2024 : 02:23:18
I meant how can I put object[1].bitmap object[5].bitmap or object[2].path, object[].line in the pdf file to the back or front.
xequte Posted - Jun 09 2024 : 19:23:04
Please use this method:

// Load our background image
ImageEnView1.IO.LoadFromFile( 'D:\_Testfiles\TestImages\Test2.png' );


// Load our foreground image
bmp := TIEBitmap.Create( 'D:\Temp\Cartoonify1.png' );


// Convert white background to alpha (transparent)
bmp.SetTransparentColors( clWhite, clWhite, 0 );

// Draw foreground image onto background image
bmp.DrawToTIEBitmap( ImageEnView1.IEBitmap, 0, 0 );
bmp.Free();

// Update the ImageEnView
ImageEnView1.Update();



Nigel
Xequte Software
www.imageen.com
srtt Posted - Jun 09 2024 : 17:28:26
I didn't see it in this demo.
How can I put one of the 2 images on 1 pdf page in front or behind?
BringToFront? and sendtoback?
xequte Posted - Jun 05 2024 : 19:03:01
Hi

Please see the demo:

\Demos\Other\PDFPageObjects\PDFPageObjects.dpr
https://www.imageen.com/files/demos/run/Other/PDFPageObjects/PDFPageObjects.zip

Which shows how to insert an image into an existing PDF file.

Nigel
Xequte Software
www.imageen.com
srtt Posted - Jun 05 2024 : 02:50:23
Thank you very much.
Sorry for my English.
The main point here was this. I have 2 files in my hand. traced pdf (traced.pdf) and original image (orjinal.bmp) . How do I add (combine) the original image (original.bmp) to the pdf (traced.pdf) file? In other words, how can I open the pdf and place the original image in the background?
xequte Posted - Jun 05 2024 : 00:35:21
Hi

I decided to create a helper method to do this. You can email me for the updated source.









Nigel
Xequte Software
www.imageen.com

xequte Posted - Jun 04 2024 : 21:48:31


// Apply a cartoon like vector trace to an image

/// Detect and remove background
ImageEnView1.Proc.ConvertToBWLocalThreshold( 17, ietMeanMinMax );

// Smooth edges?
ImageEnView1.IEBitmap.PixelFormat := ie24RGB;
ImageEnView1.IEBitmap.SetTransparentColors( TColor2TRGB( clWhite ), 0, 0 );
ImageEnView1.IEBitmap.FeatherAlphaEdges( 5 );
ImageEnView1.IEBitmap.RemoveAlphaChannel( True, clWhite ); // Convert alpha back to white

// Darken lines
ImageEnView1.Proc.Contrast( 40 );



Nigel
Xequte Software
www.imageen.com
xequte Posted - Jun 04 2024 : 20:00:59
Hi

This is not an easy image to convert because the background is as dark in the bottom left corner as the drawing.

But you could use thresholding, e.g.

  ImageEnView1.Proc.ConvertToBWLocalThreshold( 8, ietMean );




Optionally with some smoothing:

ImageEnView1.Proc.ConvertToBWThreshold( -2 );
  ImageEnView1.IEBitmap.PixelFormat := ie24RGB;
  ImageEnView1.IEBitmap.SetTransparentColors( TColor2TRGB( clWhite ), 0, 0 );
  ImageEnView1.IEBitmap.FeatherAlphaEdges( 1 );
  ImageEnView1.IEBitmap.RemoveAlphaChannel( True, clWhite ); // Convert alpha back to white





Or Edge detection:

ImageEnView1.Proc.EdgeDetect_Sobel();




ImageEnView1.IEBitmap.PixelFormat := ie8g;
  ImageEnView1.IEBitmap.GetIEVisionImage().canny(0. 166, 3 );
  ImageEnView1.IEBitmap.Negative()
;




To draw the result onto another image use:

https://www.imageen.com/help/TIEBitmap.DrawToTIEBitmap.html


Nigel
Xequte Software
www.imageen.com