开发者

C# How to store Brush/Pen information in a database table

I need to store Brush/Pen information about several shapes in a database table, one row for each layer I draw.

I was thinking of two schemes:

BRUSH_INFO                 PEN_INFO
SolidBrush(Color.Red)      Pen(Color.Black)

pros: only two colums

cons: eval'd column

BRUSH_INFO   PARAM_B1   PARAM_B2 ... PEN_INFO  PARAM_P1     PARAM_P2 ...
SolidBrush   开发者_开发技巧Color.Red  (null)       Pen       Color.Black  (null)        

pros: parameters are separated

cons: many columns

I think the second one should be generic enough but I'm not sure.

What schema will you use to store this kind of information?

Can you suggest a table structure so that I can store any kind of Brush/Pen with its parameters?


I would use seperate tables for brush and pen information. So you could reuse the same brush/pen for multiple shapes.


Store them as XML Serialized data, no tables needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜