문제

I store information about images in a database - also their ImageFormat (jpeg, png etc).

Console.WriteLine(System.Drawing.Imaging.ImageFormat.Jpeg.Guid);  

Outputs: b96b3cae-0728-11d3-9d7b-0000f81ef32e

I want to store this in the database as a GUID - and read from the database and get the associated ImageFormat.

How do I cast the GUID b96b3cae-0728-11d3-9d7b-0000f81ef32e to System.Drawing.Imaging.ImageFormat.Jpeg.Guid ?

도움이 되었습니까?

해결책

이를위한 많은 도구가 있습니다 :

  • http://lesscss.org/
  • http://leafo.net/lessphp/
  • "noreferrer"> http://sass-lang.com/
  • http://compass-style.org/

    일반적으로 CSS 전 처리기라고합니다.

    함수 정의 (일반적으로 "mixin"라고 함)와 같은 이후에 한 번만 쓰는 것을 종료합니다.

    .linear-gradient(@start, @end) {
        background-color: @end;
        background-image: -webkit-gradient(linear, left top, left bottom, from(@start), to(@end)); /* Safari 4+, Chrome */
        background-image: -webkit-linear-gradient(top, @start, @end); /* Safari 5.1+, Chrome 10+ */
        background-image:    -moz-linear-gradient(top, @start, @end);  /* FF3.6 */
        background-image:      -o-linear-gradient(top, @start, @end); /* Opera 11.10+ */
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@start', endColorstr='@end'); /* IE */
    }
    
    .

    적용하려면 다음을 적용합니다.

    .my-class {
        .linear-gradient(#54a0ce, #3584ba);
    }
    .my-other-class {
        .linear-gradient(#ccc, #aaa);
    }
    
    .

    가 추천합니다.

다른 팁

1) store GUID in a database instead of JPEG

2) use constructor:

ImageFormat(
    Guid guid
)

Doesn't ImageFormat's constructor let you get the ImageFormat by its Guid?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top