Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, July 29, 2008 9:08:20 PM(UTC)
razali84

Groups: Registered
Posts: 21


hello guys,

how to load and place new image automatically on top of image that has been load first.

first load TIF image then load gif image to place on top of TIF image.

please help

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, July 29, 2008 11:34:24 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

If you want to place GIF image on top of the TIF image, you can try to do this by using the combine method. The details depend on the LEADTOOLS version and the programming interface (API, C++ Class Library, .Net, etc.) that you use.

For example, if you are using LEADTOOLS v15 .Net programming interface, you can use the CombineCommand class as follows:
+-------+
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
RasterImageViewer1.Image = codecs.Load("C:\TempFiles\OCR1.TIF", 800, 600, 8, RasterSizeFlags.Resample, CodecsLoadByteOrder.Bgr, 1, 1)

Dim GifImage = codecs.Load("C:\TempFiles\eye.gif", 200, 200, 8, RasterSizeFlags.Resample, CodecsLoadByteOrder.Bgr, 1, 1)

Dim command As CombineCommand = New CombineCommand
command.SourceImage = GifImage.Clone
command.DestinationRectangle = New
System.Drawing.Rectangle(RasterImageViewer1.Image.Width / 4, RasterImageViewer1.Image.Height / 4, GifImage.Width, GifImage.Height)
command.SourcePoint = New System.Drawing.Point(100, 100)
command.Flags = CombineCommandFlags.OperationAdd Or CombineCommandFlags.Destination0 command.Run(RasterImageViewer1.Image)

RasterCodecs.Shutdown()
+-------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, July 29, 2008 11:39:33 PM(UTC)
razali84

Groups: Registered
Posts: 21


sorry coz not mentioned this before.

 

i'm using version v14.5 API using  vb 6

 
#4 Posted : Wednesday, July 30, 2008 12:38:16 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Before providing you with more details, I need to know the following:

Do you mean that you want to place the GIF image on top of the TIF image and change the pixel data so that you end up with one image?

Or you mean that you want to place the GIF image as a layer over the TIF image without changing the pixel data?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Wednesday, July 30, 2008 12:44:13 AM(UTC)
razali84

Groups: Registered
Posts: 21


thanks for your reply,

i want to place the gif image on top of the tif image and change the tif image and the pixel. so it will end up with one image.

 
#6 Posted : Wednesday, July 30, 2008 12:47:42 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You can use the L_CombineBitmap function. This function combines image data from two bitmaps, letting you specify the areas to be combined and the operations to be performed when combining the data. Both images must have the same color resolution and the same palette, if a palette is required.

For more information, please read the following topics in the LEADTOOLS Raster Imaging API Help File:
- Combining Images
- L_CombineBitmap
- L_CombineBitmapExt

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#7 Posted : Wednesday, July 30, 2008 1:02:49 AM(UTC)
razali84

Groups: Registered
Posts: 21


sorry, can u give me some sample code related in this matter, actually i'm a newby on this product
 
#8 Posted : Wednesday, July 30, 2008 1:30:21 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Try the following code:

/********************************/
BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image*/
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */
int XDst;  /* Column offset of the destination */
int XSize; /* Pixel width of the rectangle to combine */
int YDst;  /* Row offset of the destination */
int YSize; /* Pixel height of the rectangle to combine */
int XSrc;  /* Column offset of the source */
int YSrc;  /* Column offset of the source */

/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("c:\\TempFiles\\OCR1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("c:\\TempFiles\\eye.gif"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Specify a position in the top left part of the displayed image */
XDst = BITMAPWIDTH(&LeadBitmap) / 8;
YDst = BITMAPHEIGHT(&LeadBitmap) / 8;
/* Use the full size of the source bitmap */
YSize = BITMAPHEIGHT(&TmpBitmap);
XSize = BITMAPWIDTH(&TmpBitmap);
XSrc = 0;
YSrc = 0;
/* Combine TmpBitmap with LeadBitmap, using flags for an ordinary paste */
L_CombineBitmap(&LeadBitmap, XDst, YDst, XSize, YSize,
&TmpBitmap, XSrc, YSrc, CB_OP_ADD | CB_DST_0);
/*Save LeadBitmap*/
L_SaveBitmap(TEXT("c:\\TempFiles\\LeadBitmap.TIF"), &LeadBitmap, FILE_TIF, 24, 0, NULL);

/* Free the temporary bitmap */
L_FreeBitmap (&TmpBitmap);
/********************************/

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.081 seconds.