Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to include image file in the program with turbo c

Posted on 1999-07-05
12
Medium Priority
?
188 Views
Last Modified: 2013-11-18
Assume that i have included the image file as background. How to draw an object on the image without erasing the image? Please write for me a simple source for that.
0
Comment
Question by:lewis_loo
[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
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 3

Expert Comment

by:PinTail
ID: 1263284
What is your problem.

How many times do you need to be told that this is not the forum for getting your work done for you, we simply answer specific questions.

Your questions are hardly specific enough to qualify
0
 
LVL 1

Expert Comment

by:FuzzyLogic
ID: 1263285
At least accept(reject) the answers for the previous questions you asked.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1263286
and try to increase the # of points when you ask questions... noone's gonna do it for you for 5, 10, 15, or 20 pts...

you should save the specific area where your image is and then put it back...

something like this....

i'm assuming you're working with VGA mode 13h... 320x200x256 that is...

void GetBlock(char* block, int x, int y)
{
  for (int i = 0; i < 10; i++)
    memcpy(&block[i*10], &vga[(y+i)*320+x], 10);
}

void PutBlock(char* block, int x, int y)
{
  for (int i = 0; i < 10; i++)
    memcpy(&vga[(y+i)*320+x], &block[i*10], 10);
}

do you understand how this works?

..-=ViKtOr=-..
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:lewis_loo
ID: 1263287
You answer for a complete source then I will increase the points for you increase to 30 how about that?
0
 
LVL 1

Author Comment

by:lewis_loo
ID: 1263288
You answer for a complete source then I will increase the points for you increase to 30 how about that? and explain it in detail?
0
 
LVL 1

Author Comment

by:lewis_loo
ID: 1263289
No, What I mean is I want to learn from you all with the source without the source how could I know, because I am beginner in C programming.So please excuse
0
 
LVL 3

Expert Comment

by:PinTail
ID: 1263290
Look buddy,

You have got a few choices:

1.) Improve your command of the English language, so that you can communicate your ideas more clearly and concisely.

OR

2.) Include some sample source code which illustrates the exact nature of your problem ( Source Code is a 'language' we will all understand - It doesn't matter if it's 'C' 'C++', BASIC, Fortran, etc.. someone will know it, and be able to help )

It would help if you ask the question in the appropriate forum.  Don't ask 'C' or MFC specific questions in the Windows programming topic area, etc..

It would also help if you realised that nobody is going to bother with your questions if you only advertise their value at 10, or 20 points.  The guidelines are pretty clear on this.  If your question is really simple, it's worth about 50 points, if your question is really complicated, it's worth AT LEAST 200 points.


0
 
LVL 10

Accepted Solution

by:
viktornet earned 100 total points
ID: 1263291
lewis_loo, i gave you the source code example... all you get for 20 points are the functions... you get to write the test program yourself.. i aint writing that for you... 30 points aint enough either... 100 will be enough I guess... what I gave you was for 50 points so please... next time when you post a question please try to assign at least 50 points for the question.. (that is an easy one) and your questions aren't easy and you demand that we give you complete examples too... well, buddy (as PinTail quoted ;-)) that's not the way it goes....

-vik-
0
 
LVL 1

Author Comment

by:lewis_loo
ID: 1263292
Adjusted points to 50
0
 
LVL 1

Author Comment

by:lewis_loo
ID: 1263293
Ok I have Increase it to 100 please write for me a complete source for that?
I use Driver VGA and Mode VGAHI
0
 
LVL 1

Author Comment

by:lewis_loo
ID: 1263294
Ok I have Increase it to 100 please write for me a complete source for that?
I use Driver VGA and Mode VGAHI
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1263295
i did it for you lewis_loo.. you just need to get in that mode, and use the functions... that's all....

void main()
{
  char* block[110]; //a few additional bytes just in case ;-))

  asm mov ax, 0013h
  asm int 10h

  //Draw your background here, you know images, etc...

  GetBlock(block, 20, 20);
  //Draw something in that 10x10 area... draw it at x=20 and y=20
  getch();
  PutBlock(block, 20, 20);

  getch();
  asm mov ax, 0003h
  asm int 10h
}

that's it... not tested but should work...

btw, vga should be declared like this...

unsigned char far *vga=(unsigned char far *)0xA0000000L;

Good Luck!!

..-=ViKtOr=-..
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to useā€¦
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

704 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