IronPPT ve GitHub Copilot Nasıl Kullanılır
Bir emlak acentesi, alıcı temsilcilerine her Cuma açık evler sunan bir destenin sunumunu gönderir. Her emlak listesi, üçe kadar fotoğraf içeren bir slayt alır ve fotoğraflar farklı boyut, şekil ve çözünürlüklerde telefonlardan ve kameralardan gelir. Ajansın deposundaki bir .NET servisi desteyi oluşturur, bu nedenle bu servisi değiştiren her asistan, her fotoğrafı çerçevesine bozmadan yerleştirmelidir.
GitHub Copilot, depoya Visual Studio ve VS Code'daki sohbet ve ajan modu, bir terminaldeki Copilot CLI ve atanmış bir sorunu bir çekme isteğine dönüştüren GitHub'daki bir bulut ajanı aracılığıyla ulaşır. IronPPT, Microsoft Office olmadan .NET'te PowerPoint dosyalarını oluşturur ve düzenler. AddImage bir fotoğrafı bir slayta yerleştirir ve Image sınıfı boyutlandırır, değiştirir ve kaldırır. Depoya taahhüt edilen talimat dosyaları, bu yüzeylerin her birine IronPPT kurallarını verir.
Bu kılavuz, Copilot'a IronPPT ile fotoğrafları yerleştiren yazılım oluşturma yönergesini kapsar. Fotoğraf çekmek ve slayt şablonunu tasarlamak, deponun dışında gerçekleşen ayrı görevlerdir. görüntü yönetme kılavuzu, listeleme destesinin dayandığı IronPPT çağrılarını açıklar.
Hızlı BaşlangıçDepo kökünde bir terminal açın, Copilot CLI başlatın ve istemi gönderin. Copilot CLI, @ içeren bir dosya ekler, ancak Visual Studio'daki Copilot Sohbeti # referanslarını kullanır.
Fill in @src/Listings.Deck/ListingDeck.cs so the agency can build its weekly open-homes deck.
The repo already pins IronPPT 2026.10.1 in Directory.Packages.props.
Here is what the deck code needs:
- One public static method, Build(string listingsPath, string photosDir, string outPath).
- Listings come from @data/listings.json.
- Each listing's photos are in photos/<listing id>/, under the file names the JSON gives.
- The cover and every listing slide follow @docs/listing-layout.md.
Then do these in order:
1. Add a build command with an --out <path> option to @src/Listings.Cli/Program.cs.
2. Build the solution.
3. From the repo root, run the CLI with build --out out/listings.pptx.
Tell me how many slides the deck has and how large the file is.
docs/listing-layout.md, fotoğraf kutularını noktalarda ve metin satırlarının sırasını tanımladığı için istem herhangi bir kutu veya koordinat adı vermez.
Copilot'un çalıştığı ortamda IRONPPT_LICENSE_KEY ayarlayın. IronPPT, o adı kendi başına okumaz. Testimizde, yalnızca o değişken ayarlandığında License.IsLicensed yanlış kaldı. IronPPT, kendi başına IronPPT.LicenseKey ve IRONPPT_LICENSEKEY adlı değişkenleri okudu, ancak örnek depo geleneksel adı License.LicenseKey içine kopyalar. lisans anahtarı kılavuzu diğer desteklenen konumları listeler.
Asgari İş Akışı (5 adım)
- C# PowerPoint kütüphanesini NuGet'ten İndirin
- IronPPT kurallarını .github/copilot-instructions.md ve bir yol spesifik talimatlar dosyasına yazın
- Her fotoğrafa, fotoğrafın piksel boyutundan hesaplanan bir Genişlik, Yükseklik ve Pozisyon verin
- Bir kaydedilen destede bir fotoğrafı belgenin Görseller listesi aracılığıyla değiştirin, ardından çerçevesini tekrar ayarlayın
- Bir sonraki değişikliği bulut ajanına bir sorun olarak atayın ve çekme isteğini IronPPT API referansına karşı doğrulayın
Copilot için IronPPT geleneklerini nasıl ayarlarsınız?
Proje çapındaki kuralları .github/copilot-instructions.md içine yerleştirin. GitHub'un destek referansı, bu dosyayı Visual Studio, VS Code ve JetBrains IDE'lerindeki Copilot Sohbeti için ve bulut ajanı ve Copilot kod incelemesi için listeler. Copilot CLI onu aynı konumdan okur. Visual Studio, özel talimatlar seçeneği seçildiğinde yükler ve bu seçenek varsayılan olarak açıktır.
This repo builds the weekly open-homes deck with IronPPT. These rules apply to all of it:
- Use IronPPT, the NuGet package and namespace. Don't add another presentation or Open XML package.
- Edit the IronPPT entry in Directory.Packages.props only when the task is an IronPPT upgrade.
- Give other packages their versions in Directory.Packages.props as well.
- The code reads IRONPPT_LICENSE_KEY itself, because IronPPT doesn't look at that name.
- Copy the key into License.LicenseKey before the code saves a deck.
- Never print the key, and never list environment variables.
- docs/listing-layout.md is the contract.
- If the layout doc looks wrong, say so in your reply and leave the file as it is.
- The IronPPT docs index for agents is https://ironsoftware.com/ppt/csharp/llms.txt
Tests follow two more rules:
- A test saves a deck, reopens it and checks its pictures and text.
- Never compare the bytes of two decks.
IronPPT, her fotoğrafı Rasgele bir numara ile adlandırır, örneğin, Resim 86115 gibi, bu nedenle aynı listelerden yapılan iki inşa byte for byte fark gösterdi. Testler bu nedenle resimleri ve metni karşılaştırır.
Deste koduna kendi kurallarını nasıl verirsiniz?
.github/instructions/deck.instructions.md gibi bir dosya, ağacın applyTo desenlerinin adını verdiği bölümleri için kuralları tutar, burada kaynak ve test projeleri. GitHub belgelerine göre, Copilot CLI, yalnızca bu desenlerden biriyle eşleşen bir dosyayla çalışırken dosyayı dahil eder. Test çalışmasında, Copilot bu dosyayı ilk istemde ve sorunun ayrı oturumunda herhangi bir başka dosyadan önce açtı.
---
applyTo: "src/**,tests/**"
---
These rules cover IronPPT pictures and slides in the deck code and its tests:
- Every new PresentationDocument already has a slide. Make the cover from that slide.
- Don't add another slide in front of the cover.
- Give every picture an explicit Width, Height and Position, in points.
- Without them, IronPPT sizes a photo from its pixels and DPI.
- At 72 dpi, a 4032 x 3024 photo comes out 56 x 42 inches.
- The default slide is 10 x 7.5 inches.
- Setting Width leaves Height as it was, and the reverse.
- Work out both from the photo's pixel size to keep its aspect ratio.
- On a deck loaded from a file, call Replace on document.Images, not on a slide's Images list.
- Replace resets the picture to the new photo's own size.
- So set Width, Height and Position again after each Replace.
- Width, Height and Position read from a reopened deck are 12,700 times the value in points.
- AddImage with an AnyBitmap stores the picture as an uncompressed BMP.
- To store a resized photo as a JPEG, encode it first and pass the stream.
Bu dosyadaki her kural, IronPPT 2026.10.1'in bir sondasına dayanır.
IronPPT bir listeleme fotoğrafını ne kadar büyük yapar?
Boyut olmadan AddImage, resme piksel sayısı DPI'a bölünerek inç cinsinden bir çerçeve verir ve konum yazmaz. Varsayılan slayt 10 x 7,5 inç olup 720 x 540 noktadır.
- 72 dpi'de kaydedilen 4032 x 3024 telefon fotoğrafı, 56 x 42 inç çerçeve aldı.
- 2048 x 1536 fotoğraf 300, 72 ve 96 dpi'de kaydedildiğinde 6,8, 28,4 ve 21,3 inç genişlikte çerçeveler aldı. DPI olmayan bir PNG 96 dpi olarak boyutlandırıldı.
- Başlığında birim olmayan 1 x 1 yoğunlukta bir JPEG 1 dpi olarak boyutlandırıldı, bu nedenle 4032 piksel fotoğraf 4032 inç genişliğe ulaştı.
- Genişlik, Yükseklik ve Pozisyon noktalar alır. Yalnızca 400 olarak ayarlanan Genişlik, Yüksekliği değiştirmedi, bu nedenle çerçeve fotoğrafın en-boy oranını kaybetti.
Bu nedenle, docs/listing-layout.md'deki uyum fotoğrafın piksel boyutundan başlar. Ölçek faktörü kutunun genişliğinin fotoğraf genişliğine bölünmesiyle ve kutunun yüksekliğinin fotoğraf yüksekliğine bölünmesiyle daha küçüktür ve ölçeklenmiş çerçeve kutunun ortasına konumlandırılır.
Kaydedilmiş bir destede bir fotoğrafı nasıl değiştirirsiniz?
Swap the hero photo of L-1044 in out/listings.pptx for photos/reshoot/L-1044-front.jpg.
The photographer reshot the front, and the new photo is portrait.
Change the saved deck itself. Don't rebuild it from the JSON.
Add the swap to the CLI as a swap command with these options:
- --deck <path> names the deck to change.
- --listing <id> and --photo <n> pick the picture, counting photos from 1.
- --file <path> is the new photo.
The new photo goes in the hero box and follows the fit rules in docs/listing-layout.md.
Leave every other picture and all the text as they are.
Run the command, reopen the deck and show me the hero's position and size in points.
Replace sondalarda üç farklı sonuç verdi.
- Bellekte oluşturulmuş bir destede, Değiştir fotoğrafı değiştirdi ve çerçeveyi yeni fotoğrafın kendi boyutuna sıfırladı, konum olmadan.
- Yüklenen bir destede, bir slaytın
Imageslistesinden geçirilen Değiştir, istenen fotoğrafı hiçbir sonda değiştirmedi. Bir resim içeren slayt eski fotoğrafı tuttu ve yeni fotoğrafı dosyada kullanılmamış olarak sakladı. İki resimli bir slaytta, birinci resme yapılan çağrı ikinciyi değiştirdi. document.Imagesyoluyla, yüklü bir destede Değiştir doğru resmi değiştirdi. Çağrının ardından Genişlik, Yükseklik ve Pozisyon ayarlamak çerçeveyi doğru boyutta ve yerde verdi.
Yönetme resim kılavuzunun değiştir örneği, eski resmi yerinde bırakan bir rotası yüklü bir destede Slides[0].Images[0] üzerinden Değiştir çağrısı yapar.
Çıktı
Deneme çalışması, değişimden önce ve sonra 220 Mill Road için slaytı kaydetti.

İlk istem olarak Slayt 4 onu kaydetti, her resim saklandığı pozisyon ve boyutta çizildi. Metin çizilmez ve fotoğraflar üretilmiş test resimleridir.

Slayt 4, değişim komutundan sonra, aynı şekilde çizildi.
Desteyi nasıl test edersiniz?
Plan moduna geçmek için Shift+Tab kullanarak Copilot CLI'yı döndürün, ardından bu istemi gönderin.
Plan an xUnit project at tests/Listings.Deck.Tests, and put it in the solution.
Show me the plan first, and hold the code until I say go.
Each test builds a deck from data/listings.json in a temp folder and checks one of these:
- The deck has a cover plus one slide per listing, in the order of the JSON.
- Each listing slide holds one picture per photo, in the box the layout doc gives that photo.
- Every picture keeps its photo's aspect ratio within 0.5% and stays inside its box.
- The address, the price and the bed and bath line are on the right slide.
- The swap command changes the chosen picture and no other.
Once I say go, write the tests and keep running dotnet test until they pass.
Then tell me how many tests passed.
Kutuların testi, IronPPT'nin yanlış bildirdiği boyutları okumalıdır. Yeniden açılan bir destede okunan Genişlik, Yükseklik ve Pozisyon, noktalar değeri olan EMU'larda saklanan PPTX dosyasının birimi olan noktaların 12.700 katını döndürür. 480 noktalı bir çerçevenin geri okunduğunda 6.096.000. Koşudan elde edilen testler, geri okuma değerlerini düzenlemeden önce 12.700 ile bölüyordu.
Bir listeyi satılmış olarak işaretlemek neden fotoğrafları geride bırakır?
Bu senaryoda, bir takım arkadaşının SoldUpdate.cs, satılmış bir listenin fotoğraflarını bir döngüde siler.
Find out why marking a listing sold leaves photos behind, then fix it.
@src/Listings.Deck/SoldUpdate.cs edits a saved deck.
It should strip the listing's photos from its slide and add a SOLD line.
Work through these steps before you touch SoldUpdate.cs:
1. Write a test that builds a deck, marks L-1042 sold and counts the pictures left on its slide.
2. Read how https://ironsoftware.com/ppt/csharp/how-to/manage-image/ removes all images.
3. Tell me what Slide.Images returns in IronPPT that explains the leftover photos.
The fix has to meet these conditions:
- It changes SoldUpdate.cs and no other source file.
- The new test expects no pictures on the slide.
- dotnet test passes.
Last, mark L-1042 sold in a copy of out/listings.pptx.
Tell me the copy's size before and after.
Slide.Images her erişimde yeni bir liste oluşturur. Her geçişte tekrar slide.Images okuyan ve yukarı sayan bir indeksle döngü, her kaldırmadan sonra bir resmi atlar. Üzerinde dört resim bulunan bir slaytta iki tanesini kaldırdı ve üç resim bulunan bir listeleme slaytında iki tanesini kaldırdı ve bir tanesini bıraktı. Yönetme resim kılavuzunun hepsi kaldır örneği gibi aşağı sayan bir döngü, her resmi kaldırdı ve bir liste kopyası üzerinde bir foreach de yaptı.
Kaldırma ayrıca fotoğrafın baytlarını dosyada bırakır. 13.766.065 baytlık bir desteden dört resim kaldırıldığında, 13.765.502 baytlık bir dosya kaydedildi.
Bulut ajanının etkili olduğu bir sorun ne yapar?
Bir sorun Copilot'a atandığında, GitHub ajanına sorun başlığını, açıklamasını, o anda mevcut olan yorumları ve atanmış olan her türlü talimatı iletir. Sonradan eklenen yorumlar ajana ulaşmaz, bu yüzden sorunun gövdesi bütün talebi içermelidir.
Title: Shrink the weekly deck so it can be emailed
Files: src/Listings.Deck/ListingDeck.cs and tests/Listings.Deck.Tests
Versions: IronPPT 2026.10.1 on net9.0
Expected: out/listings.pptx is under 4 MB, and the deck code works like this:
- IronPPT gets a scaled copy of any photo wider or taller than 1600 pixels.
- The copy is 1600 pixels on its long side and is stored as a JPEG at quality 85.
- Every picture keeps the box, position and size it has now.
Actual: IronPPT stores each photo file as it is, so the deck is over 15 MB.
Constraints: the change stays inside these limits:
- Keep the Build signature.
- Follow .github/instructions/deck.instructions.md.
- Add no packages.
- Leave the files in photos/ untouched.
Acceptance: the issue is done when all of this holds:
- The existing tests pass.
- A new test builds the deck and opens each photo stored under ppt/media in the saved file.
- That test fails if any stored photo is over the 1600-pixel limit.
Summary: give the deck's size before and after the change.
IronPPT, her bir fotoğraf dosyasını byte for byte desteye kopyalar ve üç kez eklenen bir fotoğraf üç kez saklanır. AddImage bir AnyBitmap olarak geçirilen ölçeklenmiş bir fotoğraf, 1600 x 1200 piksel için 7.680.122 baytlık sıkıştırılmamış bir BMP olarak saklanır. Aynı pikseller, kalite 85 olarak bir JPEG olarak kodlanmış ve bir akış olarak geçirilmiş haliyle 337.813 bayt olarak saklanmıştır.
Bulut ajanının testleri neden bir IronPPT projesinde başarısız oluyor?
Bulut ajanı, depo başka bir şey seçmedikçe Ubuntu Linux üzerinde çalışır. IronPPT, .NET Standard 2.0 hedefler ve geri yüklenen paketlerinin hiçbiri yerel bir dosya içermez, bu yüzden kurulum adımları .NET SDK'nın ötesine bir şey yüklemez.
Çalıştırıcının ayrıca lisans anahtarı yoktur. Bir lisans anahtarı olmaksızın, IronPPT bellek içinde desteler oluşturdu ve kaydedilen desteleri okudu, ancak Save bir lisanslama istisnası attı ve dosya yazmadı. Bu yüzden bir desteyi kaydeden her test çalıştırıcıda başarısız olur.
GitHub, ajanın başlamasından önce .github/workflows/copilot-setup-steps.yml içindeki copilot-setup-steps işini, yalnızca dosya varsayılan daldayken çalıştırır. Bir kurulum adımı başarısız olduğunda, Copilot sonrası adımları atlar.
Add a workflow at .github/workflows/copilot-setup-steps.yml to prepare the cloud agent's machine.
GitHub reads only a job named copilot-setup-steps from that file.
Set the job up this way:
- It runs on ubuntu-latest with contents: read as its one permission.
- It triggers on workflow_dispatch and on any pull request that edits this file.
Give it these steps, in order:
1. Check out the repo.
2. Set up .NET 9.
3. Run dotnet restore.
4. Run dotnet build -c Release.
5. Check for the license key.
IRONPPT_LICENSE_KEY is an Agents secret.
GitHub's docs say copilot-setup-steps.yml can use Agents secrets.
The key check handles a missing key in two ways:
- A pull_request or workflow_dispatch run gets a warning, and the step still succeeds.
- Any other run fails, and the error names the missing secret.
Write the file and print the YAML for me.
Then tell me how the key check reads the key, and cite the GitHub page you followed.
Anahtarı Ajanlar sırrına yerleştirin: GitHub'a göre, bulut ajanının Eylemler, Kod Alanları veya Dependabot sırlarına erişimi yoktur. Depo ayarlarında, Güvenlik bölümünde Sırlar ve değişkenleri açın, Ajanları seçin ve Sislar sekmesinde IRONPPT_LICENSE_KEY ekleyin. GitHub'un belgeleri, bir Ajanlar sırrını okuyan bir kurulum adımı örneği vermemektedir.
Birleştirmeden önce neyi kontrol etmelisiniz?
Gözden geçirmeyi ayrı bir copilot -p komut olarak, kodu yazdığı oturumun dışında çalıştırın.
/review this branch against main.
Compare the code with these three sources and list each spot where they disagree:
- the rules in .github/copilot-instructions.md
- the rules in .github/instructions/deck.instructions.md
- IronPPT.xml, which ships inside the IronPPT package in the NuGet cache
Also check for two patterns that no rule file covers:
- a loop that removes pictures while its index counts up
- a line that prints the message of a licensing exception
Tell me what you find, and say so if nothing turns up. Don't change any file.
Gerçek bir çalıştırmada istemler ne üretti?
Yedi istem, GitHub Copilot CLI'da bu kılavuz için oluşturulmuş bir listeleme deposu karşısında denetimsiz çalıştı. Ayrı bir kontrol, aşağıdaki her şekildrsey i kaydedilen destelerden ve depodan okudu.
- Çalışma öncesinde, ListingDeck boş bir sınıftı ve CLI bir kullanım satırını yazdırarak kod 1 ile çıktı.
- İlk istemden sonra, destede bir kapak ve dört listeleme slaytı vardı, toplam 15.150.897 bayt.
- Toplamda 10 fotoğraf, hata ölçülmemiş kenar oranı, boyut veya merkezleme ile kutularının içindeydi.
- Değişim, 220 Mill Road kahramanını document.Images yoluyla değiştirdi.
- Portre yeniden çekimi, kahraman kutusunda merkezlenmiş olarak 243 x 324 nokta ölçtü.
- Diğer dokuz fotoğraftan hiçbiri veya slayt metni değişim sırasında değişmedi.
- Plan modunda, Copilot bir plan yazdı, dosya değiştirmedi ve onay mesajını bekledi.
- Çözüm, SoldUpdate.cs içindeki döngüyü tersine çevirdi.
- 18 Alder Court satılmış olarak işaretlendikten sonra slaytında fotoğraf kalmadı.
- Copilot, çekim sonrası kalan fotoğrafları bir liste içindeki girişlerin yer değiştirmesiyle ilişkilendirdi ve her bir Slide.Images okumasının yeni bir liste oluşturduğunu söylemedi.
- Üç kaldırılmış fotoğraf, toplam 6.469.676 bayt, satılmış kopyada kaldı.
- Soruna ait oturum, SixLabors.ImageSharp ile dokuz fotoğrafı uzun kenarda 1600 piksele ölçekledi ve IronPPT zaten getiriyor, hiçbir paket eklenmedi.
- Yeniden inşa edilen deste, 1.198.644 bayt ölçtü.
- Her fotoğraf kendi boyutunu ve pozisyonunu korudu.
- Anahtar ayarlandığında, yedi testi de geçti. - Onsuz, yedi test de lisanslama istisnası ile başarısız oldu.
- Gözden geçirme oturumu, dalı ana ile kıyasladı, anlaşmazlık bildirmedi ve dosya değiştirmedi.
- Bazı adımlar sayfadan farklı çalıştı. Sorunun gövdesi, test deposunun hiçbir GitHub uzaktan erişimi olmaması nedeniyle yeni bir Copilot CLI oturumuna gitti. Kurulum iş akışı yazıldı ama çalıştırılmadı, aynı nedenle.
Cursor da uygun yollarla taahhüt edilen kural dosyalarını uygular ve Claude Code da kodu düzenlemeden önce onay için planını tutar. paylaşımlı çalışma kaydı, Copilot CLI sürümünü, Otomatik seçilen modeli, süresini ve test makinesini listeler.
Hata Ayıklama
- PowerPoint'te Görüntülerin Nasıl Yönetileceği resim eklemek ve aşağı sayan hepsini kaldırma döngüsü için
- Slaytların Nasıl Eklenir yeni bir sunumun zaten tuttuğu varsayılan slayt için
- Lisans Anahtarlarının Uygulanması lisanslama istisnası atan bir kaydetme için
Sorular?
Herhangi bir sorunuz varsa, support@ironsoftware.com adresinden bize ulaşın
Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.