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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEvolution ImageList Image Emboss/Annotation
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

brandonbrown

USA
37 Posts

Posted - Jan 26 2021 :  16:38:19  Show Profile  Reply
Pardon the interruption for which might be a stupid question or method for what I am try to do. I *think* I almost have it, however I could use a little help, especially if there is a better way to do this.

Essentially I just want to write a text string on an image within an image list. I can do the entire thing, but then I have to save it to a file to reload it into the imagelist. There's got to be a better way, so I was doing it with the Microsoft Drawing library. Here's the code snippet:


Dim img As New HiComponents.IEvolution.IEImage

img = multiScan.ImageList.GetImage(0)



'multiScan.ImageList.CopyTo(multiScan.ImageList.ImageCount - 1, img)
Dim original As System.Drawing.Bitmap = img.CreateBitmap()
Dim newImage = New Bitmap(img.Width, img.Height)

Dim gr = Graphics.FromImage(newImage)
Dim pnt As New Rectangle

'Dim fnt As New Font("Free 3 of 9", 48, FontStyle.Regular)
Dim fnt As New Font("Courier New", 48, FontStyle.Regular)
gr.DrawImage(original, 0, 0)

gr.DrawString("2021012099998888", fnt, Brushes.Black, New RectangleF(20, 20, 1000, 100))

newImage.Save("C:\tmp\goodie.bmp")

I can save the bitmap as a BMP and load it back. My question is, how can I take the bitmap and load it back into the imagelist with the embossed/annotated image? Everything I've tried so far causes an exception.

Thanks in advance!


~brandon

xequte

38613 Posts

Posted - Jan 27 2021 :  01:54:53  Show Profile  Reply
Hi Brandon

You should call ReleaseImage after your changes:

https://www.imageen.com/ievolutionhelp/html/38fff9a0-2838-fb32-2a9a-d9f7e35023a8.htm

Enabling the saveChanges parameter.

You should then call multiScan.ImageList.UpdateImages or multiScan.Update

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

brandonbrown

USA
37 Posts

Posted - Jan 27 2021 :  08:24:22  Show Profile  Reply
Nigel, thank you for giving me that piece of info, the app would have crashed if I hadn't done the release.

Did you understand what I am trying to do? Put text (annotate) the image with a specific string that would be saved in on the TIFF bitmap.

I am having to call the Windows Drawing library, then save the bitmap as a file, load it back into IEvolution Imagelist. This seems like NOT the way to do it. Is there an easier way to do that all inside of IEvolution. I just really want to put at time/date stamp on an multipage TIFF and save it. I think I'm close, I just had to use the Windows framework. Is there another thread that references that?

Thanks in advance, this project is almost done!
Go to Top of Page

xequte

38613 Posts

Posted - Jan 27 2021 :  13:50:24  Show Profile  Reply
Hi

I don't think there is a more efficient way to draw text than you are using.

You could also use a text layer and merge it into the image, but it would be inefficient for this task:

https://www.imageen.com/ievolutionhelp/html/59dcfb3a-75e4-7c46-728d-5c89fb20ba57.htm

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

brandonbrown

USA
37 Posts

Posted - Jan 27 2021 :  13:52:05  Show Profile  Reply
Good to know and thank you for the quick response. I'll just leave in what I have. Thanks again for a quality product!
Go to Top of Page

xequte

38613 Posts

Posted - Jan 27 2021 :  15:52:49  Show Profile  Reply


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: