Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MapPos(var map_pt: TPoint): Boolean;
- var
- old_client, minimap, map, w, h: Integer;
- m_minimap: TMask;
- begin
- old_client := GetImageTarget;
- minimap := CreateBitmap(155, 115);
- CopyClientToBitmap(minimap, 353, 72, 508, 187);
- FastReplaceColor(minimap, 255, 0);
- FastReplaceColor(minimap, 16711422, 0);
- FastReplaceColor(minimap, 65535, 0);
- FastReplaceColor(minimap, 16776960, 0);
- m_minimap := CreateMaskFromBitmap(minimap);
- map := LoadBitmap(IncludePath + '\RSCS\map.bmp');
- FastReplaceColor(map, 24495, 0);
- FastReplaceColor(map, 409605, 0);
- SetTransparentColor(map, 0);
- SetTargetBitmap(map);
- GetClientDimensions(w, h);
- Result := FindMaskTolerance(m_minimap, map_pt.X, map_pt.Y, 0, 0, (w - 1), (h - 1), 0, 0);
- if Result then
- begin
- CopyClientToBitmap(minimap, map_pt.X, map_pt.Y, (map_pt.X + 154), (map_pt.Y + 114));
- SaveBitmap(minimap, (AppPath + 'MAPS\minimap.bmp');
- end else
- begin
- map_pt.X := -1;
- map_pt.Y := -1;
- end;
- SetImageTarget(old_client);
- FreeBitmap(map);
- FreeBitmap(minimap);
- end;
Advertisement
Add Comment
Please, Sign In to add comment