Gdiplus [45]: igpgraphics (4) about rendering quality and synthesis Mode

Source: Internet
Author: User
Related content:
 
Igpgraphics. smoothingmode; {drawing quality} igpgraphics. interpolationmode; {interpolation mode} igpgraphics. compositingmode; {combination of foreground and background colors} igpgraphics. compositingquality; {image synthesis quality} igpgraphics. pixeloffsetmode; {pixel offset mode} {used for text rendering quality} igpgraphics. textrenderinghint; {text rendering mode} igpgraphics. textcontrast; {text gray correction positive value (eliminating Gamma Correction for sawtooth and cleartype text )}

  

Related parameters:

Smoothingmode {the path gradient Paint Brush cannot be controlled for the edges of straight lines, curves, and filled areas.} invalid // an invalid mode default // do not eliminate the sawtooth, equivalent to highspeed and nonehighspeed // do not remove sertices highquality // eliminate sertices, equivalent to antialiasnone // do not remove sertices antialias // remove sertices
  
   
 Interpolationmode {interpolation mode determines how to calculate the median between two pixels} invalid // an invalid element equivalent to the qualitymode enumeration. default // default mode. low // low-quality interpolation method. high // high quality interpolation method. bilinear // bilinear interpolation; no pre-screening; this mode is not applicable when the image is reduced to less than 50% of the original size. bicubic // double three-step interpolation; no pre-screening; this mode is not applicable when the image is reduced to less than 25% of the original size. nearestneighbor // near interpolation method. highqualitybilinear // high quality bilinear interpolation method; performs pre-screening to ensure high quality shrinkage. highqualitybicubic // high quality double three interpolation method; performs pre-screening to ensure high quality shrinkage; produces the highest quality conversion image.
  
   
 Compositingmode {color merging mode} sourceover // mixed with the background color; this mixture is determined by the transparency sourcecopy // rewrite the background color
  
   
 Compositingquality {during image synthesis, source pixel and target pixel and synthesis method} invalid // invalid quality default // default quality highspeed // high speed, low quality highquality // high quality, low speed Compound gammacorrected // use Grayscale Correction assumelinear/ /assume the Linear Value
  
   
 Pixeloffsetmode {pixel offset mode} invalid // invalid mode. default // default mode. highspeed // high speed, low quality rendering. highquality // high quality, low speed presentation. NONE // No pixel offset. half // the horizontal and vertical distances of pixels are both offset-0.5 units for high-speed sawtooth elimination.
  
   
 

Smoothingmode test:


 
Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; pen: igppen; rect: tgprectf; I: integer; begin graphics: = tgpgraphics. create (handle); pen: = tgppen. create ($ ffb22222, 4); rect. initialize (clientwidth * 3/8, clientheight * 3/8, clientwidth/4, clientheight/4); for I: = 0 to 4 Do begin graphics. smoothingmode: = tgpsmoothingmode (I); graphics. drawellipse (pen, rect); rect. inflate (clientwidth/14, clientheight/14); end;

  

Interpolationmode test:


Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; Image: igpimage; rect: tgprectf; I: integer; begin graphics: = tgpgraphics. create (handle); Image: = tgpimage. create ('C: \ gdiplusimg \ grapes.jpg '); rect. initialize (10, 10, image. width * 0.5, image. height * 0.5); for I: = 0 to 7 do begin graphics. interpolationmode: = tgpinterpolationmode (I); graphics. drawimage (image, rect); rect. offset (rect. width + 10, 0); If rect. X + rect. width> clientwidth then begin rect. x: = 10; rect. offset (0, rect. height + 10); end; Procedure tform1.formresize (Sender: tobject); begin repaint; end;

  

Compositingmode test:


Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; brush: igplineargradientbrush; rect: tgprect; begin graphics: = tgpgraphics. create (handle); rect. initialize (20, 20,200, 60); brush: = tgplineargradientbrush. create (rect, $ ffa52a2a, $ ffffff00, 0); graphics. compositingmode: = compositingmodesourceover; // default mode: graphics. fillrectangle (brush, rect); brush: = tgplineargradientbrush. create (rect, $ 80a52a2a, $80ffff00, 0); graphics. compositingmode: = compositingmodesourceover; rect. offset (0, 20 + rect. height); graphics. fillrectangle (brush, rect); graphics. compositingmode: = compositingmodesourcecopy; rect. offset (0, 20 + rect. height); graphics. fillrectangle (brush, rect); end;

  

Compositingquality test:


Uses gdiplus; procedure merge (Sender: tobject); var graphics: igpgraphics; Image: igpimage; rect: tgprectf; brush: igpsolidbrush; I: integer; begin graphics: = tgpgraphics. create (handle); Image: = tgpimage. create ('C: \ gdiplusimg \ grapes.jpg '); rect. initialize (10, 10, image. width * 0.75, image. height * 0.75); brush: = tgpsolidbrush. create ($ 800000ff); for I: = 0 to 4 Do begin graphics. compositingquality: = tgpcompositingquality (I); graphics. drawimage (image, rect); graphics. fillrectangle (brush, rect); rect. offset (rect. width + 10, 0); If rect. X + rect. width> clientwidth then begin rect. x: = 10; rect. offset (0, rect. height + 10); end; Procedure tform1.formresize (Sender: tobject); begin repaint; end;

  

Pixeloffsetmode test:


 uses gdiplus; Procedure injection (Sender: tobject); var graphics: igpgraphics; brushback: igphatchbrush; brush: igpsolidbrush; rect: tgprectf; I: integer; begin graphics: = tgpgraphics. create (handle); brushback: = tgphatchbrush. create (hatchstylecross, $ ffd0d0d0, $ ffffffff); graphics. fillrectangle (brushback, tgprect. create (clientrect); rect. initialize (0.34, 1, 5.1, 1.3); brush: = tgpsolidbrush. create ($80ff0000); graphics. scaletransform (27.3, 17.3); for I: = 0 to 4 Do begin graphics. pixeloffsetmode: = tgppixeloffsetmode (I); graphics. fillrectangle (brush, rect); rect. offset (0, rect. height + 1); end;

   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.