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 : Thursday, November 25, 2010 8:14:52 PM(UTC)

Noufal  
Noufal

Groups: Registered
Posts: 21


Hello..(Leadtool16)  I have attached an image , actually, i want to  change the background of transparent image in rasterimageviewer, like that picture...
Noufal attached the following image(s):
test.PNG
 

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 : Thursday, November 25, 2010 8:19:49 PM(UTC)

Noufal  
Noufal

Groups: Registered
Posts: 21


The Viewer should look like the following image
 
#3 Posted : Thursday, November 25, 2010 8:21:23 PM(UTC)

Noufal  
Noufal

Groups: Registered
Posts: 21


The rasterimageviewr should look like the following image
Noufal attached the following image(s):
test2.PNG
 
#4 Posted : Saturday, November 27, 2010 11:19:50 PM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,034

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


You can do that using RasterImageViewer.BackgroundImage() Method. This code will set the background to black:
RasterImage image = new RasterImage(RasterMemoryFlags.Conventional, 200, 200, 24, RasterByteOrder.Bgr, RasterViewPerspective.LeftTop, null, IntPtr.Zero, 0);
Image backImage1 = image.ConvertToGdiPlusImage();
_viewer.BackgroundImage = backImage1;

You can use a similar code to load your image like this:
RasterCodecs codecs = new RasterCodecs();
RasterImage image = codecs.Load(@"C:\test.PNG");
Image destImage1 = image.ConvertToGdiPlusImage();
_viewer.BackgroundImage = destImage1;
Guest attached the following image(s):
background.JPG
 
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-2020, Yet Another Forum.NET
This page was generated in 0.110 seconds.