Frames of Pictures

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2003
Posts: 4
Reputation: josef is an unknown quantity at this point 
Solved Threads: 0
josef josef is offline Offline
Newbie Poster

Frames of Pictures

 
1
  #1
Dec 19th, 2003
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2003
Posts: 22
Reputation: Mike29936 is an unknown quantity at this point 
Solved Threads: 0
Mike29936 Mike29936 is offline Offline
Newbie Poster

Re: Frames of Pictures

 
1
  #2
Dec 20th, 2003
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 4
Reputation: josef is an unknown quantity at this point 
Solved Threads: 0
josef josef is offline Offline
Newbie Poster

Re: Frames of Pictures

 
0
  #3
Dec 22nd, 2003
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2003
Posts: 22
Reputation: Mike29936 is an unknown quantity at this point 
Solved Threads: 0
Mike29936 Mike29936 is offline Offline
Newbie Poster

Re: Frames of Pictures

 
0
  #4
Dec 23rd, 2003
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?
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 4
Reputation: josef is an unknown quantity at this point 
Solved Threads: 0
josef josef is offline Offline
Newbie Poster

Re: Frames of Pictures

 
0
  #5
Jan 5th, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 5
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: Frames of Pictures

 
0
  #6
Jan 5th, 2004
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.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Sep 2003
Posts: 22
Reputation: Mike29936 is an unknown quantity at this point 
Solved Threads: 0
Mike29936 Mike29936 is offline Offline
Newbie Poster

Re: Frames of Pictures

 
0
  #7
Jan 8th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 5
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: Frames of Pictures

 
0
  #8
Jan 9th, 2004
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.

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.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 4
Reputation: josef is an unknown quantity at this point 
Solved Threads: 0
josef josef is offline Offline
Newbie Poster

Re: Frames of Pictures

 
0
  #9
Jan 9th, 2004
many thanks to all of you!
it is very rare, that people are so selfless and give such a helping hand.
best wishes,
josef
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC