Changeset 203
- Timestamp:
- Mar 17, 2011, 9:49:34 AM (14 years ago)
- Location:
- GraphicTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/GraphicTest.lpi
r202 r203 55 55 <ResourceBaseClass Value="Form"/> 56 56 <UnitName Value="UMainForm"/> 57 <IsVisibleTab Value="True"/>58 57 <EditorIndex Value="0"/> 59 58 <WindowIndex Value="0"/> 60 <TopLine Value="1 07"/>61 <CursorPos X=" 1" Y="122"/>59 <TopLine Value="1"/> 60 <CursorPos X="27" Y="38"/> 62 61 <UsageCount Value="32"/> 63 62 <Loaded Value="True"/> … … 182 181 <IsPartOfProject Value="True"/> 183 182 <UnitName Value="UDrawMethod"/> 183 <IsVisibleTab Value="True"/> 184 184 <EditorIndex Value="6"/> 185 185 <WindowIndex Value="0"/> 186 <TopLine Value="1 "/>187 <CursorPos X=" 33" Y="15"/>186 <TopLine Value="196"/> 187 <CursorPos X="10" Y="206"/> 188 188 <UsageCount Value="26"/> 189 189 <Loaded Value="True"/> … … 236 236 <TopLine Value="584"/> 237 237 <CursorPos X="3" Y="597"/> 238 <UsageCount Value="1 0"/>238 <UsageCount Value="11"/> 239 239 <Loaded Value="True"/> 240 240 </Unit22> … … 392 392 <Position29> 393 393 <Filename Value="UDrawMethod.pas"/> 394 <Caret Line=" 179" Column="22" TopLine="164"/>394 <Caret Line="211" Column="28" TopLine="196"/> 395 395 </Position29> 396 396 </JumpHistory> -
GraphicTest/UDrawMethod.pas
r202 r203 193 193 Y, X: Integer; 194 194 PixelPtr: PInteger; 195 RowPtr: PInteger; 195 196 P: TPixelFormat; 196 197 RawImage: TRawImage; 197 198 BytePerPixel: Integer; 199 BytePerRow: Integer; 198 200 begin 199 201 P := Bitmap.PixelFormat; … … 202 204 Bitmap.BeginUpdate(False); 203 205 RawImage := Bitmap.RawImage; 204 PixelPtr := PInteger(RawImage.Data);206 RowPtr := PInteger(RawImage.Data); 205 207 BytePerPixel := RawImage.Description.BitsPerPixel div 8; 206 for X := 0 to Size.X - 1 do 207 for Y := 0 to Size.Y - 1 do begin 208 BytePerRow := RawImage.Description.BytesPerLine; 209 for Y := 0 to Size.Y - 1 do begin 210 PixelPtr := RowPtr; 211 for X := 0 to Size.X - 1 do begin 208 212 PixelPtr^ := Pixels[X, Y] * $010101; 209 213 Inc(PByte(PixelPtr), BytePerPixel); 210 214 end; 215 Inc(PByte(RowPtr), BytePerRow); 216 end; 211 217 finally 212 218 Bitmap.EndUpdate(False);
Note:
See TracChangeset
for help on using the changeset viewer.