I have made a window containing a Fixed container with two images .Here both images are dynamically set Images using Pixbuf. The two Images are overlapping . Like a frame and image .
How can I merge these images in one Image and save to the file system? Please help me I am new to this . Thanks
image12.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("TryNew.ivy.png");
According to this document, you will create a Pixbuf composite. The example there gives side-by-side images, but it would be the same principle for overlaying a frame on your picture.
Related
I'm new to this concept but I'm sure there should be solution to it. I'm storing a design (a series of lines and shapes) as XML, also can save/load the drawing into/from XML file.
Now, new idea is:
1) How to show a thumbnail of the drawing such could be placed on a toolbar or panel (as toolbox)
2) By dragging/dropping of this thumbnail on a canvas it will open and show the drawing.
You should know more about "ViewBox" that is made for thumbnail things and it has many other usages. You can give it any WPF contents and it will do the thumbnail thing by some specific options.
Cheers
I would like to know how I can create one image from many. I would like to create a tile in my windows phone application like in this image (specifically, the People tile):
(source: addictivetips.com)
I have nine pictures, and I would create an image, that I will add like tile to background. Does anybody know how can I create an image that looks like the one in that picture?
I have very little experience in this space, but have you considered creating a control that simply displays up to 9 pictures side by side in a grid like that? You then can bind each image independently & change them out however you want. This article touches on how to bind phontos in WP7 nicely:
http://msdn.microsoft.com/en-us/library/hh286418(v=vs.92).aspx
If you're talking about assembling an actual graphic image like a jpeg or bitmap, you'll need to look at the Image Class, Bitmap Class, and Graphics Class. Essentially you'll need to implement the following steps:
Load the relevant images with From method in Image, typically Image.FromFile.
Determine how many rows and columns you'll be using.
Calculate the total width and height for your layout using the widths and heights of the loaded images with appropriate padding added.
Create a new Bitmap of the appropriate size with the correct background color and iamge format.
Have variables for the current drawing location (x & y).
Have variables for the current row and column in your layout.
In a loop, Create your Graphics object.
Use Graphics.DrawImage to add your loaded image to the layout bitmap.
Increment your drawing row and or column as appropriate.
Calculate your new drawing location.
Repeat until done.
One of the options is to use WriteableBitmapEx
Also you can probably find an answer to your question here: How can I merge two images into one?
My goal is to display a large rectangular image in a section of a webpage that will act as a background for other, smaller images to be laid on top of. The smaller rectangular images will be dynamically selected based upon database entries. I was able to create a java applet that drew the larger base rectangular image and then drew the smaller images over the base image. This worked very well.
I am attempting to recreate the functionality using C# in Microsoft Visual Web Developer 2010. I have found system.drawing functionally that may work, but haven’t found a web based solution yet. Any help would be appreciated.
If I understand correctly, you want to overlay smaller images on top of another image. At the end you'll end up with one image to display. This is easy to do in C#:
string image1 = #"c:\image.jpg";
string image2 = #"c:\image2.jpg";
System.Drawing.Image canvas = Bitmap.FromFile( image1 );
Graphics gra = Graphics.FromImage( canvas );
Bitmap smallImg = new Bitmap(image2);
gra.DrawImage( smallImg, new Point( 70, 70 ) );
canvas.Save( #"c:\newimage.jpg", System.Drawing.Imaging.ImageFormat.Jpeg );
My two cents here... Another thing which helped me on .NET 2.0 and 3.0 was explicitly deleting the Image, Graphics and Bitmap objects after you are done, specially when you would be accessing any of the image sources (image1, image2 and smallImg above) within the same routine.
Deleting these objects will instantly release the file locks. I experienced that the garbage collector wouldn't necessarily clean these up for me at the desired time, even if I made a separate sub-routine for my image manipulation.
I am working on an Image manipulation application which will be developed using Flash/ C#.Net. Is this possible to save the image manipulations (not the image) saved from Adobe Lightroom for a specific image & then merge these change sets with an image to make a new image using C#.Net?
Also, the application for image manipulation will be developed in the Flash/ Action Script. Please share some links as to how we can save the image manipulations for an image (not the image) so that it can be merged with an image later on.
Kindly suggest some links.
Just store a list of commands e.g.
1 -> rotate on 90 degree
2 -> move 10px. left
....
In my project user will upload an image and the logo of project will be attached(Embeded) to the bottom of the image.
Is it possible to implement?
If yes then how to implement that?
Please help.
Yes it is possible to implement.
Look at the System.Drawing namespace.
You can use the Bitmap class - it will allow you to load images from files.
Create two bitmaps, one from each image then you should be able to impose the logo image onto the other one.
This is one fun example of how to do it:
Image backImg = Image.FromFile("bg.jpg");
Image mrkImg = Image.FromFile("watermark.png");
Graphics g = Graphics.FromImage(backImg);
g.DrawImage(mrkImg, backImg.Width/2, 10);
backImg.Save("result.jpg");
Some people call this watermarking, I would search around for that.
Have a look at http://www.codeproject.com/KB/GDI-plus/watermark.aspx