?
Solved

Drawing Parts of an Image with C#

Posted on 2004-10-18
5
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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: 12354644
Thanx
Glad to help :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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