Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows GDI+ C#4.0
Dears All,
Kindly i need your help.
 
I’m a C# beginner.
I want to build a windows application in C#.Net, the application should design-on multiple phases- a secure document based on curves generation and exported as Bmp file.
Pseudo procedure:
 
step1-import bmp file.
step 2-transform the bmp to 2D array.
step 3-draw on the array in specific locations using curves generation(parametric [Bezier, B-spline and cubic B-Spline]).
step 4-add desired text on desired location.
step 4-export the result array as bmp file.
step 5-may be the same file imported again for further drawing—go to step1.
 
I’m facing a problem with 2D Drawing of curves(parametric [Bezier, B-spline and cubic B-Spline] ) generation programming on 2D matrix then export results as Bmp file.
 
I surveyed the Web for references about such subject, but I don’t find anything meet my needs.
can you help me please? If you have any useful advice, references, code examples, or anything may help in this subject I’ll be grateful.
 
Your kind support is highly appreciated.
Posted 9-Dec-12 3:03am
as45834
Edited 9-Dec-12 3:12am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I assume you know how to draw the curves but have a problem with drawing on bitmaps. Here is how you do it: you create a bitmap, obtain and instance of the System.Drawing.Graphics for this bitmap, and use it for drawing. Something like:
 
int width = //...
int height = //...

//...

string fileName = //...

//...

using (System.Drawing.Bitmap bitmap = new Bitmap(width, height)) {
    System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
    // draw on bitmap using graphics:
                // graphics.DrawBeziers,
                // graphics.DrawBezier,
                // graphics.DrawCurve,
                //etc.
    bitmap.Save(fileName);
} // important: bitmap.Dispose is automatically called here
 
Please see:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx[^].
 
—SA
  Permalink  
Comments
as45 at 19-Dec-12 16:54pm
   
many thanks with appreciation
that's was useful to solve important part of the issue
but, do you have any idea about how to control the locations of the image?
i have to design a document in multiple phases then print them all to have one secure document.
can you help please
Sergey Alexandrovich Kryukov at 19-Dec-12 18:07pm
   
You are very welcome. About the location: I don't see where is the problem. Perhaps you will need to post a separate questions and explain it really well. If you want to notify me on that new question, post a comment to my present comment (by "Reply").
 
And — good luck, call again.
—SA
as45 at 20-Dec-12 17:54pm
   
Dear Mr. Kryukov,
thank you very much for the help.
may i fail in explaining what i need
but i have to draw secure document using curves generation something like this
http://mocii.com/uploads/2010/12/guilloche-patterns-vector-336x280.jpg
or this http://www.banknotenews.com/files/myanmar_10000_k_2012.00.00_b16a_pnls_ac_4329212_r.jpg
 
i mean i have to draw 32 bmp image and print them on one photo paper to have on document.
can you guide me on how can i do that? if you have reference , ebook or code example.
your help will be highly appreciated
Sergey Alexandrovich Kryukov at 21-Dec-12 0:31am
   
Oh, you call that security. Hm...
Well, I think I already answered — the code sample and links show all you need for such rendering. Of course new will need to understand some mathematics behind Bezier and everything else. If you need guidance, please explain what else do you miss...
—SA
as45 at 22-Dec-12 9:16am
   
many thanks Mr. Kryukov.
Sergey Alexandrovich Kryukov at 22-Dec-12 20:04pm
   
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 Sergey Alexandrovich Kryukov 170
4 PIEBALDconsult 160
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100