Click here to Skip to main content
15,904,926 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello:)
I'm doing my greeting card editor application. and I want to insert pictures of backgrounds that the user can use when creating his one card. how can I do it? thank you for helping:D
Posted

"Don't know. I'm a little bit confused!! please can you send me the code in c# language. I'm not able to deal with images in a winform. I don't know what to do. it's my first experience."
We're here to help people learn how to program, as well as with application design issues, and to assist people when they are stuck writing code. With rare exceptions, no one here is going to send you the code.

It's important you take the initiative and start writing code. But, if you are not ready for that, the least you can do is search CodeProject for articles that use PictureBox, and ImageList, and that show you how to create thumbnails.

Start by studying the WinForm PictureBox Control. Put a PictureBox on a Form, and write the code to load an Image into it.

Learn how to create a ThumbNail of an Image read from a File.

Put a ListView on a Form, and set its 'View property to 'LargeIcon, or 'SmallIcon.

Put an ImageList Component on the Form, and add Images to it.

Set either the 'LargeImageList or 'SmallImageList properties of the ListView to the ImageList depending on whether you specified the 'View property as 'LargeIcon or 'SmallIcon.

Add Items to the Listview using the ListViewItem constructor that takes a string, and an index into the ImageList to display the Image. YourListView.Items.Add(string, Int32).
 
Share this answer
 
Comments
Member 11308295 27-Dec-14 15:12pm    
thq u a lot. this really helped me :D
The best way is to create a folder under the Application Data folder that you can check, and the user (or your application) can add images to.
This should help you locate it: Where should I store my data?[^] - you don't have to use Guids, you can use your application name and "Backgrounds" for example to make it easier for the user to find.

Then, just load the images (using the Image.FromFile[^] method) and then paint it yourself (good idea) or use a PictureBox (OK idea, but poor if you deal with lots of images).
 
Share this answer
 
Comments
Member 11308295 27-Dec-14 12:04pm    
thank you. but the idea is that the programmer(me) is going to set images that the user will choose one of them as a background to his card. like in the power point app there are many backgrounds that the user can choose. how can I do like this
OriginalGriff 27-Dec-14 12:23pm    
What part of this is giving you difficulties?
Member 11308295 27-Dec-14 12:38pm    
Don't know. I'm a little bit confused!! please can you send me the code in c# language. I'm not able to deal with images in a winform. I don't know what to do. it's my first experience.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900