代码之家  ›  专栏  ›  技术社区  ›  Kjensen

将guid转换为system.drawing.imaging.imageformat

  •  4
  • Kjensen  · 技术社区  · 15 年前

    我将有关图像的信息存储在一个数据库中——也就是它们的图像格式(jpeg、png等)。

    Console.WriteLine(System.Drawing.Imaging.ImageFormat.Jpeg.Guid);  
    
    Outputs: b96b3cae-0728-11d3-9d7b-0000f81ef32e
    

    我想把它作为一个guid存储在数据库中,然后从数据库中读取并获取相关的imageformat。

    如何转换guid B96B3CAE-0728-11D3-9D7B-0000F81EF32E 到 系统.drawing.imaging.imageformat.jpeg.guid ?

    3 回复  |  直到 15 年前
        1
  •  3
  •   M.A. Hanin    15 年前

    你提供了一个 System.Guid System.Drawing.Imaging.ImageFormat constructor 你可以用它的 Guid 属性。

    一个system.guid有几个 constructors ,包括 string 建造师。

        2
  •  1
  •   garik    15 年前

    1)将guid存储在数据库中,而不是jpeg

    2)使用施工单位:

    ImageFormat(
        Guid guid
    )
    
        3
  •  0
  •   Alexey B.    15 年前

    ImageFormat's constructor 让您通过它的guid获取imageformat?

    推荐文章