943,515 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 7530
  • C++ RSS
Dec 19th, 2003
1

Frames of Pictures

Expand Post »
Hello C++ Guys,
is it possible to make automatic frames for pictures on my web site with C++?
Thank you very much for your help.
Have a nice Christmas,
Josef
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
josef is offline Offline
4 posts
since Dec 2003
Dec 20th, 2003
1

Re: Frames of Pictures

Let me get this straight:

You want a program that will take a picture, and output a new picture with frames?

If so, it should be fairly easy, I think. Just make a bitmap with a little space on each side of the original, and then use the Windows functions to draw on that little space. A normal frame should only take about 3 lines per space, at most.
Last edited by Mike29936; Dec 20th, 2003 at 9:04 am.
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Mike29936 is offline Offline
22 posts
since Sep 2003
Dec 22nd, 2003
0

Re: Frames of Pictures

Hello Mike,
thank you very much for your fast answer.
It is very nice that you thought about my problem.
But, I am not quiet sure if I understand you right.
I allready have pictures but I just want them to have frames around them
when I post them on my web site, and I just thought maybe there is a possibilty to do so with c++?
So, thank you very much, again.
Best wishes for the holidays,
Josef
Reputation Points: 11
Solved Threads: 0
Newbie Poster
josef is offline Offline
4 posts
since Dec 2003
Dec 23rd, 2003
0

Re: Frames of Pictures

Well, do you want to change the pictures themselves to have frames, or add frames around the pictures on your web page?

In the first case, you can create a bigger bitmap, and draw a frame around it.

In the second case, I'm afraid you'll have to use some HTML to get the frames around it. If you're using PHP, I'm sure you can write a function that adds a frame around a picture.

But C++ is for applications, so unless you want to write your own Apache that adds frames on your pictures, you'll have to either change the pictures(either with Photoshop or making a program that does it for you), or use HTML with the pictures.

Maybe you could write a C++ program that outputs HTML for frames around a picture?
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Mike29936 is offline Offline
22 posts
since Sep 2003
Jan 5th, 2004
0

Re: Frames of Pictures

Hi Mike,
thank you very much for your answer and sorry for my late reply. now i wrote a c++ program that outputs a html. thank you very much for your help.
josef
Reputation Points: 11
Solved Threads: 0
Newbie Poster
josef is offline Offline
4 posts
since Dec 2003
Jan 5th, 2004
0

Re: Frames of Pictures

I assume this must be a school project of some sort where you have to do it this way. If you want a border or a frame look around your pictures, you can put your pictures in an HTML table and change the thickness of the border of the table. Doing it in C++ is more than overkill. You'd have to read the image as binary, calculate coordinates, deal with palettes, then reconstruct the image file. Even if you knew C++ well, it might require a little bit of work if you had a good library. Then you'd have to make it CGI accessible. Good luck.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Jan 8th, 2004
0

Re: Frames of Pictures

Quote ...
You'd have to read the image as binary, calculate coordinates, deal with palettes, then reconstruct the image file.
MoveToEx(startoffilex+4,startoffiley+4);
LineTo(endoffilex-4,startoffiley+4);
LineTo(endoffilex-4,endoffiley-4);
LineTo(startoffilex+4,endoffiley-4);
LineTo(startoffilex+4,startoffiley+4);

That's to draw the frame. To get the bigger picture, just make a new bitmap with 8 pixels more width and height, and bitblt into the middle.

I could probably do it in a day, but I'm too lazy to, and he already said he made it output HTML.

Note that I was talking about Windows, not Linux or any other operating system.

And he doesn't have to make it CGI accessible. He can just use it to make the pictures with frames, and use <img> tags to place the framed pictures in.
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Mike29936 is offline Offline
22 posts
since Sep 2003
Jan 9th, 2004
0

Re: Frames of Pictures

Quote originally posted by Mike29936 ...
MoveToEx(startoffilex+4,startoffiley+4);
LineTo(endoffilex-4,startoffiley+4);
LineTo(endoffilex-4,endoffiley-4);
LineTo(startoffilex+4,endoffiley-4);
LineTo(startoffilex+4,startoffiley+4);

That's to draw the frame. To get the bigger picture, just make a new bitmap with 8 pixels more width and height, and bitblt into the middle.

I could probably do it in a day, but I'm too lazy to, and he already said he made it output HTML.
Yes, you could, like I said before, if you use premade libraries. I've had to do this from scratch in Turbo Pascal and let me tell you, it didn't take a day.

Quote originally posted by Mike29936 ...
And he doesn't have to make it CGI accessible. He can just use it to make the pictures with frames, and use <img> tags to place the framed pictures in.
How else would he access the C++ program from the page to access the modified images? I don't think he meant to say C++ though, but I could be wrong. It would just be overkill for what he wants to do.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Jan 9th, 2004
0

Re: Frames of Pictures

many thanks to all of you!
it is very rare, that people are so selfless and give such a helping hand.
best wishes,
josef
Reputation Points: 11
Solved Threads: 0
Newbie Poster
josef is offline Offline
4 posts
since Dec 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Big Game need progrmmers
Next Thread in C++ Forum Timeline: c++ learning advice





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC