I wonder how to saving one picture( bitmap format in memory ) in svg format in c++ ( on windows ).anyone help me ? I need your help . my programing tool is visual c++ 6.0.
I wonder how to saving one picture( bitmap format in memory ) in svg format in c++ ( on windows ).anyone help me ? I need your help . my programing tool is visual c++ 6.0.
Have you read the specs yet? If not, start there first. After writing a bit of code you can always ask questions here if you get stuck.
yes i have read the syntax of svg ,and i can create some pictures by wirting code in notepad. the problem is that i cannot make the chinese display correctly and the solutions I found are mainly based on the ultraedit32 . I must make the tranformation by programing other than the ultraedit32, because that was one function of my program . can you give me some advices
Well, let's see the code you're using then. As far as I can tell, it's just an issue of setting up the font element correctly.
> I wonder how to saving one picture( bitmap format in memory ) in svg format in c++
You're already too late.
If you want to generate SVG, then you need to start with the "DrawRectangle" call (and all the other API calls you made to paint the picture in your bitmap), and output the relevant SVG at that point.
Examining a whole bunch of red pixels in a bitmap sometime later will be a hell of a lot harder to do, with less than optimal results.
Unless all you want is
<image xlink:href="mypicture.bmp">
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
my code is as followings, I really don't know how to make it display the chinese
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg>
<circle cx = "100" cy = "100" r = "50" style="fill:rgb(255,255,255); stroke:rgb(0,0,0);stroke-width :1 "/>
<circle cx = "200" cy = "100" r = "50" style="fill:rgb(255,255,255); stroke:rgb(0,0,0);stroke-width :1 "/>
<rect x = "100" y = "50" width = "100" height = "100" style=" fill:rgb(255,255,255) ; stroke:rgb(0,0,0);stroke-width:0"/>
<line x1= "100" y1 = "50" x2 = "200" y2 ="50" style="stroke:rgb(0,0,0) ;stroke-width:1"/>
<line x1 = "100" y1 = "150" x2 = "200" y2 = "150" style="stroke:rgb(0,0,0) ;stroke-width:1" />
<text style= "fill:black;" font-size = "30" font-family="LiSu" x = "100" y = "70" width="200" height="30">你好吗?
</text>
</svg>
What Salem was pointing out to you is that it would make more sense to generate the SVG file *while* you are generating the bitmap (since SVG is optimised for vector representations of images, you could generate the appropriate SVG element at the point where each individual shape, etc, is being rendered to the bitmap).
You've encoded the file as an English-language UTF-8 document.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
Read this.