Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Drawing over pictures (bmp, gif, jpeg)

Posted on 1999-01-20
2
Medium Priority
?
1,851 Views
Last Modified: 2013-11-20
I'm trying to write an application to display a picture (gif,bmp,jpeg) and then have the ability to draw rectangular shapes over the top of this picture.  Is there an easy way of displaying the picture and drawing the shapes over the top without the picture being rubbed out?  Any help would be appreciated. Thanks in advance.

~Ian
0
Comment
Question by:iankosh
[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
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 1328053
One idea is to use the layering method. That is you keep track of these objects that can be pictures or shapes in list. This list would then be the order in which to draw the items. For example, if you draw from the first item to the last item in the list and you wanted a shape to be on top of a picture, then make sure that the picture is located earlier in the list than the shape.

Of course, this means that you will need to support transparencies, but that isn't too hard for gifs, but bmp and jpg do not support transparency.
0
 
LVL 2

Expert Comment

by:MelissaC
ID: 1328054
I suppose you don't have to save the changes to the picture? I build an app once that displayed a bitmap and had to draw different lines on the bitmap each time a button was clicked.
Just put the bitmap in a picture control, get the device context of it, and use CPen or whatever you like to paint over it.
To stop the image from flickering, use a MemDC.
Good luck
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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