Application/Delphi Lecture126 Print Preview in Delphi for .NET This is a simple demo of how you can integrate a .NET compiler into your applications and compile and use the code at runtime. How does this all work. For this example i created a simple form with a button on it. Pressing this button starts a OpenFile Dialog and when you select a text file it renders this file to a Preview component. To print you need to create a PrintDocument component. For thi.. 2008. 8. 13. How do I Access the pixels in a GDI+ bitmap? function lockBitmap(Bitmap : TGPBitmap) : TBitmapData; var r : TGPRect; begin r.x := 0; r.y := 0; r.width := bitmap.getWidth; r.height := bitmap.getHeight; Bitmap.LockBits(r, ImageLockModeRead or ImageLockModeWrite, Bitmap.GetPixelFormat, result); end; function Scanline(BitmapData : TBitmapData; Row : integer) : PRGBQuad; begin result := bitmapData.Scan0; inc(PByte(result), Row * bitmapData.stri.. 2008. 8. 13. How do I flip text procedure TForm29.PaintBox1Paint(Sender: TObject); var graphics : TGPGraphics; FontFamily: TGPFontFamily; Font: TGPFont; SolidBrush: TGPSolidBrush; Matrix : TGPmatrix; SolidPen : TGPPen; r : TGPrectF; GraphicsPath : TGPGraphicsPath; begin graphics := TGPGraphics.Create(PaintBox1.Canvas.handle); FontFamily := TGPFontFamily.Create('Times New Roman'); Font := TGPFont.Create(FontFamily, 32, FontStyl.. 2008. 8. 13. How do I create a rounded rect function CreateRoundRectangle(rectangle: TGPRect; radius: integer): TGPGraphicsPath; var path : TGPGraphicsPath; l, t, w, h, d : integer; begin path := TGPGraphicsPath.Create; l := rectangle.X; t := rectangle.y; w := rectangle.Width; h := rectangle.Height; d := radius shl 1; // divide by 2 // the lines beween the arcs are automatically added by the path path.AddArc(l, t, d, d, 180, 90); // tople.. 2008. 8. 13. 이전 1 ··· 3 4 5 6 7 8 9 ··· 32 다음