Changeset 26 for trunk/UCore.pas
- Timestamp:
- Dec 22, 2016, 5:07:02 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r15 r26 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, ActnList, UProject, U Graphic, Controls, Graphics,8 Classes, SysUtils, FileUtil, ActnList, UProject, UFGraphics, Controls, Graphics, 9 9 ExtDlgs, ExtCtrls; 10 10 … … 87 87 begin 88 88 Project := TProject.Create; 89 90 ColorManager.RegisterFormat(TGColorFormatRGBA8);91 ColorManager.RegisterFormat(TGColorFormatRGB565);92 ColorManager.RegisterFormat(TGColorFormatGray8);93 ColorManager.RegisterFormat(TGColorFormatGray4);94 ColorManager.RegisterFormat(TGColorFormatGray1);95 89 end; 96 90 … … 103 97 begin 104 98 // Set default 105 Project.Bitmap.ColorFormat := Color Manager.Formats[0];99 Project.Bitmap.ColorFormat := ColorFormatManager.Formats[0]; 106 100 Project.Bitmap.Size := Point(200, 100); 107 if ColorManager.FormatCount > 0 then108 Project.Bitmap.ColorFormat := ColorManager.Formats[0];109 101 Project.View.DestRect := Bounds(0, 0, FormMain.PaintBox1.Width, FormMain.PaintBox1.Height); 110 102 Core.AZoomAll.Execute; … … 114 106 begin 115 107 if FormNew.ShowModal = mrOk then begin 116 Project.Bitmap.ColorFormat := T GColorFormat.Create;108 Project.Bitmap.ColorFormat := TColorFormat.Create; 117 109 118 110 Project.FileName := 'New image'; 119 111 Project.Bitmap.Size := Point(FormNew.SpinEditWidth.Value, FormNew.SpinEditHeight.Value); 120 Project.Bitmap.ColorFormat := Color Manager.Formats[FormNew.ComboBoxColorFormat.ItemIndex];121 Project.Bitmap.BackgroundColor.FromTColor(clBlack);122 Project.Bitmap.DPI := FormNew.SpinEditDPI.Value;112 Project.Bitmap.ColorFormat := ColorFormatManager.Formats[FormNew.ComboBoxColorFormat.ItemIndex]; 113 // Project.Bitmap.BackgroundColor.FromTColor(clBlack); 114 // Project.Bitmap.DPI := FormNew.SpinEditDPI.Value; 123 115 AZoomAll.Execute; 124 116 end; … … 177 169 Image.Picture.LoadFromFile(OpenPictureDialog1.FileName); 178 170 Image.Picture.Bitmap.BeginUpdate(True); 179 Project.Bitmap. LoadFromCanvas(Image.Picture.Bitmap.Canvas,180 Point(Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height));171 Project.Bitmap.Size := Point(Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height); 172 Project.Bitmap.LoadFromCanvas(Image.Picture.Bitmap.Canvas); 181 173 Image.Picture.Bitmap.EndUpdate; 182 174 Image.Free; 175 AZoomAll.Execute; 183 176 FormMain.Redraw; 184 177 Project.FileName := OpenPictureDialog1.FileName; … … 214 207 begin 215 208 Project.Bitmap.Clear; 216 Project.Bitmap.Canvas.Pen.Color.Format := Project.Bitmap.ColorFormat;217 Project.Bitmap.Canvas.Pen.Color.FromTColor(clWhite);209 TFColor(Project.Bitmap.Canvas.Pen.Color).ColorFormat := Project.Bitmap.ColorFormat; 210 TFColor(Project.Bitmap.Canvas.Pen.Color).SetColorName(cnWhite); 218 211 Project.Bitmap.Canvas.Pen.MoveTo(Point(80, 80)); 219 212 Project.Bitmap.Canvas.Pen.LineTo(Point(50, 20));
Note:
See TracChangeset
for help on using the changeset viewer.