Solved

Drawing over pictures (bmp, gif, jpeg)

Posted on 1999-01-20
2
1,833 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 100 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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