The relationship between Rect,bottom,height in Abcpdf.net

Source: Internet
Author: User

Because the project requires new functionality, add a fixed height of Baibengru to the top and bottom of a picture. The project has been using abcpdf.net to process pictures, but I have not done this function, so find the API reference to do.

This simple need to do the process of some twists and turns, mainly abcpdf.net coordinate system and imagined different.

It differs from the coordinate system used by Windows for the origin of the upper left, which uses the lower left as the origin of the coordinates (you can change the location of the origin by setting the Topdown of Doc to True). The Doc.rect property is important if you want to output an object that is output to the rectangle specified by the Rect, and the value of the RECT is continually overwritten during the operation, but the position of the previously joined object is not affected.

For the location where I need to join the object is mainly affected by the following properties Rect,bottom,height

Doc thedoc =NewDoc ();//thedoc.rect= "0 0 612 792" theDoc.Rect.Height = 792.0XImage theimg =NewXImage (); Theimg.setfile ("mbc140448xx-hf02-0101bl.tif"); TheDoc.Rect.Left=0; TheDoc.Rect.Bottom= -;//Thedoc.rect = "0 612 792" thedoc.rect.height=765TheDoc.Rect.Width = Theimg.width;//theimg.width = Thedoc.rect = "0 792" thedoc.rect.height=765TheDoc.Rect.Height = Theimg.height;//theimg.height = Thedoc.rect = "0 777" thedoc.rect.height=750Thedoc.addimageobject (Theimg,false); TheDoc.Rect.Height= Theimg.height + -;//thedoc.rect= "0 804" theDoc.Rect.Height = 777.0TheDoc.Rect.Left =0; TheDoc.Rect.Bottom=0;//thedoc.rect= "0 0 804" theDoc.Rect.Height = 804.0TheDoc.Rendering.Save ("out.tif"); Thedoc.clear ();

The values that follow the above code are the results of the execution of our statement. Through analysis of the above results, the following rules are summarized. This section of the code is mainly for the Y-direction operation, so the main consideration is Rect = {X, Y, W, H} rect.h,bottom,height.

Rect.H = Bottom+height

    • TheDoc.Rect.Bottom = Bottom change, rect.y change, Rect.H no change, but Height changed (height=792-27= 765, original default value 792). So, bottom change, Rect.H unchanged, height change
    • TheDoc.Rect.Height = Theimg.height; Height changes, Rect.H change, Rect.H = Bottom + height=27+750=777. So, bottom, height change, Rect.H change.

Did not view the source code, according to the results summarized above conclusions, for my current needs are used.

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.