Solved

Drawing Parts of an Image with C#

Posted on 2004-10-18
5
209 Views
Last Modified: 2008-02-26
I'd like to use XML to draw only parts of an image using C#. That is to say ...Something like what Winamp does for its GUI, you've got your graphics stored in .jpg or .png files, and several things stored in each image ..and the images are drawn from seperate parts of the images...so ,say I want to draw my titlebar, I've got an image named "bars.png", and the title bar is in 100,100x200,400, I want to draw only that portion of the image to the screen ..any ideas?
0
Comment
Question by:derekthornton
  • 4
5 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12344440
Are you talking about Image Strip
something like this
ImagesToolbar.Images.AddStrip((Image)Resourcer.GetObject("ImagesToolbar"));

as used in this example
http://www.codeproject.com/csharp/webbrowser.asp#xx915175xx

0
 
LVL 2

Author Comment

by:derekthornton
ID: 12346648
Eeh, No. I'm talking about using template files to store series of images...

Say, I've got a .png that has 4 or 5 different pictures in it, it's for drawing a GUI. I want to be able to draw only the image at certain coordinates from the .png to the screen, like you'd do with 3D Textures and such for wrapping them around meshes.
0
 
LVL 18

Accepted Solution

by:
armoghan earned 500 total points
ID: 12354473
Ohh i c,
What Winamp does is, it has predefined areas where it knows that which image regions are going to be, i.e. from which pixel to which pixel is going to be which button and so on. so it crops the images and place them on the required objects.

What you can do is define such regions and in your application Crop the images as different images from the main PNG and place the temp image object anywhere you want .
For croping the image
http://www.codeproject.com/csharp/imageresize.asp

0
 
LVL 18

Expert Comment

by:armoghan
ID: 12354477
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12354644
Thanx
Glad to help :)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now