Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Image in DataGridView

Image in DataGridView

Scheduled Pinned Locked Moved C#
graphicsquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nooie
    wrote on last edited by
    #1

    Hi all, I have created a form with a datagridview. I created a new Class called duplicate Picture that has 4 fields. 2 type String both hold filepaths. 2 type Bitmap that "should" hold the picture at the path set above. My constructor sets the Bitmap to be the paths as specified. I look through a file structure and find duplicate images, add them to a List of the class described above, then using CurrencyManager show a list of the path on the DataGridview as well as the image. I kept getting the little White Square with a red cross in it for the Bitmaps. So I changed the Properties for the Bitmaps to return a Image class instead, and converted the Bitmap to a Thumbnail, but that just caused more problems. Am I missing something fundamental here? Original Class I created - sing System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace DuplicateFile { class DuplicateFile { private string _shortName; private string _originalFilePath; private String _duplicateFilePath; private Bitmap _originalPicture; private Bitmap _duplicatePicture; public DuplicateFile(string newShortName, string newOriginalFilePath, string newDuplicateFilePath) { shortName = newShortName; originalFilePath = newOriginalFilePath; duplicateFilePath = newDuplicateFilePath; } public string shortName { get { return this._shortName; } set { this._shortName = value; } } public string originalFilePath { get { return this._originalFilePath; } set { this._originalFilePath = value; Bitmap originalPicture = new Bitmap(originalFilePath); } } public string duplicateFilePath { get { return this._duplicateFilePath; } set { this._duplicateFilePath = value; Bitmap duplicatePicture = new Bitmap(duplicateFilePath); } } public Bitmap duplicatePicture { get { return _duplicatePicture; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups